Autopostback not working

Discussion in 'ASP .Net' started by Ron, Aug 25, 2004.

  1. Ron

    Ron Guest

    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.
     
    Ron, Aug 25, 2004
    #1
    1. Advertising

  2. Make sure the @AutoPostBack attribute is set on the tag in the HTML. Some
    tags such as lists default to false so that the page does not refresh every
    time that some event happens.

    "Ron" <> wrote in message
    news:...
    > 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.
     
    Peter Rilling, Aug 25, 2004
    #2
    1. Advertising

  3. Ron

    Juan Romero Guest

    Set the radio list Autopostback property to TRUE.

    "Ron" <> wrote in message
    news:...
    > 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.
     
    Juan Romero, Aug 25, 2004
    #3
  4. Ron

    Ron Bell Guest

    Thanks for your quick replies.

    Didn't I do what both of you said with the the following:

    <asp:RadioButtonList ID="passchange" Enabled="false" RepeatColumns="2"
    OnSelectedIndexChanged="togglepass" AutoPostBack="true" runat="server">

    Are either of you telling me to do something different than the above
    autopostback="true". Thanks.

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Ron Bell, Aug 25, 2004
    #4
  5. Ron

    Juan Romero Guest

    Do you have any script in the page? I mean, script placed there by you?

    If not, just recompile the project.

    "Ron" <> wrote in message
    news:...
    > 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" <> wrote in message
    > > news:...
    > > > 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.

    > >
    > >
    > >
     
    Juan Romero, Aug 26, 2004
    #5
  6. And you're missing the closing </SCRIPT> tag.....

    "Ron" <> wrote in message
    news:...
    > 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" <> wrote in message
    >> news:...
    >> > 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.

    >>
    >>
    >>
     
    Harry Simpson, Aug 26, 2004
    #6
  7. javascript is case sensitive
    <asp:Button id="submit" onclick="submit_click" text="Submit"
    runat="server"/>
    but refers to
    sub Submit_Click (sender as object, e as eventargs)

    Try being consistent with the case

    Harry

    "Harry Simpson" <> wrote in message
    news:...
    > And you're missing the closing </SCRIPT> tag.....
    >
    > "Ron" <> wrote in message
    > news:...
    >> 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" <> wrote in message
    >>> news:...
    >>> > 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.
    >>>
    >>>
    >>>

    >
    >
     
    Harry Simpson, Aug 26, 2004
    #7
  8. Ron

    Juan Romero Guest

    That means you had another control in the page with the same id, lol.

    "Ron" <> wrote in message
    news:...
    > Could it really be this simple?!?
    >
    > <asp:Button id="submit" onclick="submit_click" text="Submit"
    > runat="server"/>
    >
    > In the above, I changed to 'id='btnSubmit "' and all is good!
    >
    > Thank you all for your help.
    >
    >
    > "Ron" wrote:
    >
    > > 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.
    > >
     
    Juan Romero, Aug 26, 2004
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. huobazi

    Can NOt AutoPostBack for two DDL

    huobazi, Jul 2, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    530
    huobazi
    Jul 2, 2003
  2. Neo
    Replies:
    1
    Views:
    519
    avnrao
    Jun 24, 2004
  3. =?Utf-8?B?c3Jp?=
    Replies:
    5
    Views:
    4,627
    =?Utf-8?B?c3Jp?=
    Aug 23, 2005
  4. =?Utf-8?B?aW5kaWdhdG9y?=

    Dropdownlist Autopostback not working

    =?Utf-8?B?aW5kaWdhdG9y?=, Mar 16, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    8,463
  5. kclark

    AutoPostback not working

    kclark, Apr 6, 2007, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    147
    Scott M.
    Apr 6, 2007
Loading...

Share This Page