Re: Autopostback not working
From: Harry Simpson (hssimpson_at_nospamphgt.net)
Date: 08/26/04
- Next message: Ron: "Re: Autopostback not working"
- Previous message: Harry Simpson: "Re: Update Cache with database changes"
- In reply to: Ron: "Re: Autopostback not working"
- Next in thread: Ron: "Re: Autopostback not working"
- Reply: Ron: "Re: Autopostback not working"
- Reply: Ron: "Re: Autopostback not working"
- Reply: Harry Simpson: "Re: Autopostback not working"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 26 Aug 2004 10:32:32 -0500
And you're missing the closing </SCRIPT> tag.....
"Ron" <Ron@discussions.microsoft.com> wrote in message
news:719A3C12-2399-4EBE-BA4F-DD2D853B885A@microsoft.com...
> Maybe this can clarify the problem. I just noticed the little yellow icon
> --error on page-- when I click on one of the radio buttons. The error is:
>
> Line:121, Char:3, Error:Object doesn't support this object or method,
> Code:0
>
> When I view source on the page and goto line 121, this is the code:
>
> <script language="javascript">
> <!--
> function __doPostBack(eventTarget, eventArgument) {
> var theform;
> if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
> theform = document.forms["form1"];
> }
> else {
> theform = document.form1;
> }
> theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
> theform.__EVENTARGUMENT.value = eventArgument;
> Line 121--------> theform.submit(); <---------- Line 121
> }
> // -->
> </script>
>
> Thanks again.
>
> "Juan Romero" wrote:
>
>> Set the radio list Autopostback property to TRUE.
>>
>> "Ron" <junkmail801@hotmail.com> wrote in message
>> news:e63522b1.0408251104.1859309c@posting.google.com...
>> > Hello all,
>> >
>> > I don't understand why my pageis not posting back to the server when I
>> > change the selection on a radio list.
>> >
>> > I have a page that both accepts new personal info. or allows editing
>> > to existing info depending on the parameter passed from previous
>> > pages. The radio is supposed to disable the password (and confirm
>> > password) text boxes as well as their validation controls. However,
>> > when you click 'No' (This should perform the above tasks) nothing
>> > happens. However, when you click submit to enter the edited
>> > information: it posts back, performs the OnSelectedIndexChanged
>> > procedure of the radio list as well as the OnClick of the button.
>> > Grrr.
>> >
>> > Below is (hopefully) as much code needed to disect the issue while
>> > trying to keep as brief as possible. I thank you in advance.
>> >
>> > --Start of code--
>> >
>> > <html>
>> > <script runat="server">
>> > sub page_load (source as object, e as eventargs)
>> > FormType.text = "Enter New Employee"
>> >
>> > if len(session("empnum")) = 6 then
>> > FormTypeVar = "Edit"
>> > FormType.text = "Edit Personal Information"
>> >
>> > else
>> > emppass.enabled = true
>> > empconfirm.enabled = true
>> > end if
>> >
>> > If not ispostback and formtypevar = "Edit" then
>> > passchange.enabled = "true"
>> > fill_page() --fills fields with info from DB
>> > end if
>> > end sub
>> >
>> > sub Submit_Click (sender as object, e as eventargs)
>> > If page.isvalid then
>> > If FormTypeVar = "New" Then
>> > --perform tasks for adding new employee
>> > Else
>> > --perform tasks for editing info
>> > end if
>> > end if
>> >
>> > sub togglepass(sender as object, e as eventargs)
>> > dim temp as boolean = passchange.selecteditem.value
>> > if temp then
>> > passoff = false
>> > emppass.enabled = true
>> > empconfirm.enabled = true
>> > pwvalid.enabled = true
>> > else
>> > passoff = true
>> > emppass.enabled = false
>> > empconfirm.enabled = false
>> > pwvalid.enabled = false
>> > end if
>> > end sub
>> > <body>
>> > <form runat="server">
>> > Password:
>> > <asp:TextBox id="emppass" runat="server" textmode="password"
>> > Columns="25" />
>> > <asp:CustomValidator id="pwvalid" OnServerValidate="password_validate"
>> > errormessage="Your passwords did not match, please try again."
>> > runat="server">*</asp:customValidator>
>> >
>> > <asp:TextBox id="empconfirm" runat="server" textmode="password"
>> > Columns="25" />
>> >
>> > Change your password?
>> > <asp:RadioButtonList ID="passchange" Enabled="false" RepeatColumns="2"
>> > OnSelectedIndexChanged="togglepass" AutoPostBack="true" runat="server"
>> > >
>> >
>> > <asp:ListItem Value=true Text="Yes" Selected="true"/>
>> > <asp:ListItem Value=false Text="No"/>
>> > </asp:RadioButtonList>
>> >
>> > <asp:Button id="submit" onclick="submit_click" text="Submit"
>> > runat="server"/>
>> > </form>
>> > --etc.
>>
>>
>>
- Next message: Ron: "Re: Autopostback not working"
- Previous message: Harry Simpson: "Re: Update Cache with database changes"
- In reply to: Ron: "Re: Autopostback not working"
- Next in thread: Ron: "Re: Autopostback not working"
- Reply: Ron: "Re: Autopostback not working"
- Reply: Ron: "Re: Autopostback not working"
- Reply: Harry Simpson: "Re: Autopostback not working"
- Messages sorted by: [ date ] [ thread ]