Web parts , Web User Control, Update Panel, Javascript

Last post 04-13-2007 11:46 AM by BhaveshPatel. 3 replies.

Sort Posts:

  • Web parts , Web User Control, Update Panel, Javascript

    02-20-2007, 5:42 PM

    Hi guys,  Hope this time someone replies

    first of all, Is that possible to combine all above Asp.net and Ajax controls? 

     

     

    The below one is my web user control code which I am using in the webpart zone.

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">

    <ContentTemplate>

     

    <

    asp:Panel ID="EditContainer" runat="server" DefaultButton="btnSubmit" >

    Start Date:

    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

    End Date:

    &nbsp;&nbsp;<asp:TextBox ID="TexBox2" runat="server"></asp:TextBox>

    <asp:Button ID="btnSubmit" runat="server" Text="Generate Data"

    OnClientClick="window.open('Page2.aspx?a=' + 'textbox1value' + ',' + 'textbox2value', '_blank');" 

     />

    </asp:Panel>

    </

    ContentTemplate>

    </asp:UpdatePanel>

        Now the only problem is to how to get the value of TextBox1 and TextBox2 and pass it on btnSubmit button's OnClientClick event as highlighted above without using full postback. Is that anyway I can pass this two values on Page2.aspx on submit button click without round trip????

     

    Please help, If no one can answer this , then atleast lets discuss.

     should I use javascript or ne great idea???

    work smarter, Not Harder.

    Bhavesh Patel
  • Re: Web parts , Web User Control, Update Panel, Javascript

    04-05-2007, 10:02 AM
    • Loading...
    • mjhufford
    • Joined on 06-13-2006, 4:43 PM
    • Lowell, AR
    • Posts 102

    What if you step out of the quotes in your OnClientClick statement to pass the textbox values?  Maybe like this:

     

    OnClientClick="window.open('Page2.aspx?a=' + '" & textbox1.text & "' + ',' + '" & textbox2.text & "', '_blank');" 
     
    "The pursuit of easy things makes men weak"
    ~David O. McKay
  • Re: Web parts , Web User Control, Update Panel, Javascript

    04-05-2007, 10:11 AM
    • Loading...
    • mjhufford
    • Joined on 06-13-2006, 4:43 PM
    • Lowell, AR
    • Posts 102

    Oops...I read your question wrong.  I think you will have to use JavaScript.

    <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="return MyScript();" UseSubmitBehavior="false"/>

    Then add a script in your page...maybe something like this:

    <script type="text/javascript">
        function MyScript(){
            window.open('Page2.aspx?a=' + textbox1.value + '&b=' + textbox2.value, '_blank');
        } 
    </script>
    "The pursuit of easy things makes men weak"
    ~David O. McKay
    Filed under:
  • Re: Web parts , Web User Control, Update Panel, Javascript

    04-13-2007, 11:46 AM

    thanks for you reply..

       but the problem is its not recognizing textbox1 or textbox2.... as it is nested in masterpage -> webpartzone -> updatepanel..... so i cant just simply use the javascript function as on simple aspx page without masterpage or without webpartzone etc...

     again thanks for your time

    work smarter, Not Harder.

    Bhavesh Patel
Page 1 of 1 (4 items)
Microsoft Communities
Page view counter