Search

You searched for the word(s): userid:279156

Matching Posts

  • Not (Request.QueryString("value") Is Nothing) ???

    OK, I've been working under the assumption that if a Querystring value is not in the url that I could use the following to test for it: if (Not (Request.QueryString("Value") Is Nothing)) Then HOWEVER, that one simple line is giving me an "object reference not set to an instance of an object" error. How am I supposed to check to see if the value is there or not? I THOUGHT I had been using that syntax successfully for a while, but??? TIA,
    Posted to Getting Started (Forum) by ojm37 on 11/17/2009
  • Re: Not (Request.QueryString("value") Is Nothing) ???

    [quote user="nijhawan.saurabh"] IF Not(Request.QueryString("Value")="") Then [/quote]Actually, that doesn't work. If Request is nothing (or if the request does not contain "value" on the Querystring), you get a runtime error.
    Posted to Getting Started (Forum) by ojm37 on 11/17/2009
  • Re: Not (Request.QueryString("value") Is Nothing) ???

    [quote user="MetalAsp.Net"] Where do you have that code? Maybe put a breakpoint and check the various parts for null(s). [/quote]DOH! That's it! The code was in the "New" of a server control. SO, the Request object did not yet exist! Getting it from httpContext.Current did the trick! Thanks! :-D
    Posted to Getting Started (Forum) by ojm37 on 11/17/2009
  • Get a control on server side by name?

    Anyone know if it's possible (without enumerating all the controls on the page) to "get" an object reference to an asp control by its name? For example (way simplified from what I have to show what I want): If a control is dynamically loaded into some objects controls collection and I know its name, can I -- in another part of the code that may not be directly accessible to the current running context -- get an object reference to the control if I know its name and type. Something like
    Posted to Web Forms (Forum) by ojm37 on 11/12/2009
  • Re: Get a control on server side by name?

    Thanks. With your reply, combined with Jerry's, I was able to get what I wanted. I did have an object handle to the enclosing container, so it was easy to use that objects FindControl method to get the control I needed. Thanks again!
    Posted to Web Forms (Forum) by ojm37 on 11/12/2009
  • Re: Get a control on server side by name?

    Thanks, Jerry. With your reply, combined with the next one, I was able to get what I wanted. I did have an object handle to the enclosing container, so it was easy to use that objects FindControl method to get the control I needed. Thanks again!
    Posted to Web Forms (Forum) by ojm37 on 11/12/2009
  • Re: Howto Reference UserControl from Derived control in App_Code (asp.net site)

    OK, This seems to be working so far: I created an Interface in app_code that then the control I'm loading with the LoadControl Implements. So, the code in the base control looks like this: Dim objLoadedControl as ILoadedControl objLoadedControl = CType(LoadControl("~/path/LoadedControl.ascx"), ILoadedControl) objLoadedControl.Method(params) Me.Controls.Add( objLoadedControl ) While the code in the loaded control looks like this: Partial Class LoadedControl Inherits System.Web.UI.UserControl
    Posted to Custom Server Controls (Forum) by ojm37 on 11/4/2009
  • Getting handle/object of ControlToValidate

    Is it possible, in a CustomValidator (or, better-yet in a RequiredFieldValidator that exposes a client-side javascript call!) to get the handle/object-reference of the ControlToValidate? I've tried this (I get an alert window with "undefined" in it): <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:TextBox
    Posted to Web Forms (Forum) by ojm37 on 10/30/2009
  • Re: Getting handle/object of ControlToValidate

    DOH! I need to search more (answer is here): http://forums.asp.net/t/1460834.aspx Change one line in function to: var objControl = source.getAttribute( 'ControlToValidate' ); Works.
    Posted to Web Forms (Forum) by ojm37 on 10/30/2009
  • JavaScript block indent: MY WAY!

    Anyone know if it's possible to get Visual Studio 2008 to block-indent my Javascript like this: if (var == true) { doSomeFunction(); } Instead of like this: if (var == true) { doSomeFunction(); } I've poked around in the Tools/Options - Text Editor/JScript dialog, but it doesn't seem to give the option to indent the braces, just the code. TIA,
    Posted to Visual Studio 2008 (Forum) by ojm37 on 10/30/2009
    Filed under: Visual Studio 2008 Block-indent
Page 1 of 60 (593 items) 1 2 3 4 5 Next > ... Last »