A
ABHIJIT B
Kindly help me in following
1.In my module, I am using two pages Parent(ManageUser) and Child()
page.
Parent window has textbox and button to open Child window
Child page opens as dialog window as you click on button in Parent
page using JavaScript showwmodaldialog().
Child window has textbox and button to return value back to parent
page.
I am new to ASP.NET 2.0.I tried doing following,
Aftrer entering any value in textbox of Child page and clicking Close
button value can be seen in Parent page textbox.
-----< I am doing this changes in CodeBehind files > -----
Now, I am trying to use Hidden Control using normal HTML
<input id="hdvRowID" type="hidden" runat="server" name ="hdvRowID"/>
hdvRowID.Value = "AB";
I am not able to access value in JavaScript code so it is giving error
while
taking value.
Books.book_id = document.getElementById('hdvRowID').value;
---------------------------------------------------------------------------------------------------------------------------
< Parent page code : >
if (!ClientScript.IsStartupScriptRegistered("ManageUser"))
{
ClientScript.RegisterStartupScript(this.GetType(), "ManageUser",
" <script language=javascript> " +
" function AddBook() {" +
" var returnVal = ''; " +
" returnVal =
window.showModalDialog('SearchUsers.htm', null,'status:no;dialogWidth:
500px; dialogHeight:500px;dialogHide:true;center:yes;help:no',window);
" +
"
document.getElementById('txtSLoginName').value = returnVal.book_id;
document.getElementById('txtSFirstName').value = returnVal.book_name;
" +
" return false; }" +
" </script>");
}
---------------------------------------------------------------------------------------------------------------------------
< Child page code : >
ClientScript.RegisterHiddenField("txthidLoginID1", "XYZ");
btnSUOK1.Attributes.Add("onclick", "return
ReturnBook()");
if (!
ClientScript.IsStartupScriptRegistered("SearchUsers"))
{
ClientScript.RegisterStartupScript(this.GetType(),
"SearchUsers",
" <script language=javascript> " +
" function Books() { " +
" var book_id = ''; var book_name = ''; }" +
" function ReturnBook() {" +
" var Books = new Object(); " +
" Books.book_id =
document.getElementById('textboxBookID').value; " +
" Books.book_name =
document.getElementById('textboxBookName').value; " +
" window.returnValue = Books; window.close(); }" +
//" return false; }" +
" </script>");
}
2. In our application we are using only one Master page having label
control
All pages uses Master page
<label id="lblHeader" class="ApplicationLabelStyle" style="font-
weight:normal" >DataChecker</label>
<asp:contentplaceholder id="ContentPlaceHolder1"
runat="server">
</asp:contentplaceholder>
I am trying to change Master page label lblHeader text to Manage User
using following code,I am getting error.
A.
Label lblMasterHeader = (Label)Master.FindControl("lblHeader");
lblMasterHeader.Text = "DataChecker - Manage Users";
B.
Label lblMasterHeader =
(Label)Master.FindControl("ContentPlaceHolder1").FindControl("lblHeader");
lblMasterHeader.Text = "DataChecker - Manage Users";
C.
string selectedValue =
Request.Form[this.FindControl("ContentPlaceHolder1").FindControl("lblHeader").UniqueID];
lblMasterHeader.Text = "DataChecker - Manage Users";
1.In my module, I am using two pages Parent(ManageUser) and Child()
page.
Parent window has textbox and button to open Child window
Child page opens as dialog window as you click on button in Parent
page using JavaScript showwmodaldialog().
Child window has textbox and button to return value back to parent
page.
I am new to ASP.NET 2.0.I tried doing following,
Aftrer entering any value in textbox of Child page and clicking Close
button value can be seen in Parent page textbox.
-----< I am doing this changes in CodeBehind files > -----
Now, I am trying to use Hidden Control using normal HTML
<input id="hdvRowID" type="hidden" runat="server" name ="hdvRowID"/>
hdvRowID.Value = "AB";
I am not able to access value in JavaScript code so it is giving error
while
taking value.
Books.book_id = document.getElementById('hdvRowID').value;
---------------------------------------------------------------------------------------------------------------------------
< Parent page code : >
if (!ClientScript.IsStartupScriptRegistered("ManageUser"))
{
ClientScript.RegisterStartupScript(this.GetType(), "ManageUser",
" <script language=javascript> " +
" function AddBook() {" +
" var returnVal = ''; " +
" returnVal =
window.showModalDialog('SearchUsers.htm', null,'status:no;dialogWidth:
500px; dialogHeight:500px;dialogHide:true;center:yes;help:no',window);
" +
"
document.getElementById('txtSLoginName').value = returnVal.book_id;
document.getElementById('txtSFirstName').value = returnVal.book_name;
" +
" return false; }" +
" </script>");
}
---------------------------------------------------------------------------------------------------------------------------
< Child page code : >
ClientScript.RegisterHiddenField("txthidLoginID1", "XYZ");
btnSUOK1.Attributes.Add("onclick", "return
ReturnBook()");
if (!
ClientScript.IsStartupScriptRegistered("SearchUsers"))
{
ClientScript.RegisterStartupScript(this.GetType(),
"SearchUsers",
" <script language=javascript> " +
" function Books() { " +
" var book_id = ''; var book_name = ''; }" +
" function ReturnBook() {" +
" var Books = new Object(); " +
" Books.book_id =
document.getElementById('textboxBookID').value; " +
" Books.book_name =
document.getElementById('textboxBookName').value; " +
" window.returnValue = Books; window.close(); }" +
//" return false; }" +
" </script>");
}
2. In our application we are using only one Master page having label
control
All pages uses Master page
<label id="lblHeader" class="ApplicationLabelStyle" style="font-
weight:normal" >DataChecker</label>
<asp:contentplaceholder id="ContentPlaceHolder1"
runat="server">
</asp:contentplaceholder>
I am trying to change Master page label lblHeader text to Manage User
using following code,I am getting error.
A.
Label lblMasterHeader = (Label)Master.FindControl("lblHeader");
lblMasterHeader.Text = "DataChecker - Manage Users";
B.
Label lblMasterHeader =
(Label)Master.FindControl("ContentPlaceHolder1").FindControl("lblHeader");
lblMasterHeader.Text = "DataChecker - Manage Users";
C.
string selectedValue =
Request.Form[this.FindControl("ContentPlaceHolder1").FindControl("lblHeader").UniqueID];
lblMasterHeader.Text = "DataChecker - Manage Users";