• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

ASP .NET and IIS 6 problem

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #11
    Originally posted by lightng View Post
    If you use "CommandName" and "CommandArgument" parameters for your image buttons, this will enable you to use the same event handler for your buttons and give you the ability to pass parameters.
    The problem is these image buttons are dynamically generated, and I don't seem to be able to add an OnClick in the same way that I do in .aspx.

    I've found another problem, which maybe sheds some light on the first one:

    On a different form I have a validator:

    Code:
    <asp:TextBox id="creditCardNumber" runat="server" Width="215px" />
    <asp:RequiredFieldValidator runat="server" 		            id="RequiredFieldValidator2" ControlToValidate="creditCardNumber" display="Dynamic" >!</asp:RequiredFieldValidator>
    This works fine on the local server, and if I submit without filling in the field I get a red exclamation mark. On the IIS6 server, I first get a script error: "WebForm_PostBackOptions is undefined", followed by the .NET unhandled exception page.

    It does seem the servers are doing something different. Both are running .NET 2.0.50727. Is there some other IIS6 update I need to install perhaps? Not that I can find (it it has W2003 SP1).
    Will work inside IR35. Or for food.

    Comment


      #12
      [QUOTE=VectraMan;1086809]The problem is these image buttons are dynamically generated, and I don't seem to be able to add an OnClick in the same way that I do in .aspx.[QUOTE]

      This might help. Adding an event handler to a control...

      Code:
      img.Click+=new EventHandler(img_Click);

      Comment


        #13
        Aha!

        The problem was that I hadn't associated .axd files on the server with .NET2. I guess that's an autogenerated thing because I don't have any, but I notice that returned HTML includes script from one of those. Not suprising that the script from .NET1 wouldn't work with the HTML from .NET2, though the error could have been a bit more helpful.

        Doh!

        Thanks everyone for helping. Isn't it always the way that you only spot your stupid mistake after you ask others for help?
        Will work inside IR35. Or for food.

        Comment


          #14
          That makes sense. Cross-page posting (postbackurl) didn't exist in .NET 1, so there were no client scripts to do the job.

          It was a javascript problem after all!

          Comment

          Working...
          X