master page
-
having text box and button in a master page..... issue is in child page.... when i clik on the (master) button iam not able to retain the value of (master) text box... plz help me out
-
having text box and button in a master page..... issue is in child page.... when i clik on the (master) button iam not able to retain the value of (master) text box... plz help me out
Events (as for controls are handled locally. See more in this article : http://msdn2.microsoft.com/en-us/library/dct97kc3.aspx[^]. Bit it can be solved. All info can be found in this article : http://msdn2.microsoft.com/en-us/library/c8y19k6h.aspx[^]. Hopes this helps you out.
Sven Cipido (http://blog.svencipido.be)
-
having text box and button in a master page..... issue is in child page.... when i clik on the (master) button iam not able to retain the value of (master) text box... plz help me out
Suppose: You have one textbox called "TextBox1" in MasterPage. You wanna get the value of Textbox1 from child page.. So, use the following code.
object txt = this.Master.FindControl("TextBox1"); Console.Write(txt.Text);
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
Suppose: You have one textbox called "TextBox1" in MasterPage. You wanna get the value of Textbox1 from child page.. So, use the following code.
object txt = this.Master.FindControl("TextBox1"); Console.Write(txt.Text);
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
hi thank u for ur reply iam able to read the values but the issue is once i clk Master(button) iam not able to retain the values of textbox....
-
hi thank u for ur reply iam able to read the values but the issue is once i clk Master(button) iam not able to retain the values of textbox....
humm.. You have one textbox called Textbox1 and Button1 in your Masterpage. what you wanna do is that you wanna get the value of textbox1 in the click event of button1. Is that what you want??
protected void Button1_Click(object sender, EventArgs e) { Console.WriteLine(TextBox1.Text); }
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
humm.. You have one textbox called Textbox1 and Button1 in your Masterpage. what you wanna do is that you wanna get the value of textbox1 in the click event of button1. Is that what you want??
protected void Button1_Click(object sender, EventArgs e) { Console.WriteLine(TextBox1.Text); }
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
on the postback iam not able maintain the state of (master)text box in child page..... In Master Page In child page if i enter "ravi" in textbox and clik on button iam not able to see the ravi in textbox.......... i hope its clear.....
-
on the postback iam not able maintain the state of (master)text box in child page..... In Master Page In child page if i enter "ravi" in textbox and clik on button iam not able to see the ravi in textbox.......... i hope its clear.....
Master Page. ========== <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %> Untitled Page
---------------------- Child Page ========== <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" Title="Untitled Page" %> Run the application. Put "ravi" in Textbox1. Click Button1. You will still see the "ravi" that you put.. Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
Master Page. ========== <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %> Untitled Page
---------------------- Child Page ========== <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" Title="Untitled Page" %> Run the application. Put "ravi" in Textbox1. Click Button1. You will still see the "ravi" that you put.. Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
hey iam using postback url for (master) button to redirect to another child page where i need to display the data.... In master page In Child Page.. string str = Request.Form["ctl00$Header1_txtword"].ToString(); once i clik on button the value in text box disapperaing.... -- modified at 3:24 Tuesday 10th July, 2007
-
hey iam using postback url for (master) button to redirect to another child page where i need to display the data.... In master page In Child Page.. string str = Request.Form["ctl00$Header1_txtword"].ToString(); once i clik on button the value in text box disapperaing.... -- modified at 3:24 Tuesday 10th July, 2007
-
Master Page. ========== <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %> Untitled Page
---------------------- Child Page ========== <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" Title="Untitled Page" %> Run the application. Put "ravi" in Textbox1. Click Button1. You will still see the "ravi" that you put.. Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
in master page in default.aspx if i clk on button i am not able to retain the value....