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
hdvRowID.Value = "AB";
I am not able to access value in JavaScript code so it is giving error
while
taking value.
also you should move away from a modaldialog solution. this is an IE only
feature and may be droped as IE becomes more w3c compliant. most site uses a
floating div to do this feature. the ajaxtoolkit also has a solution.
-- bruce (sqlwork.com)
"ABHIJIT B" wrote:
>
> 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
>
>
>
> 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",
> " ");
> }
> ------------------------------------------------------------ ------------------------------------------------------------ ---
> < Child page code : >
>
> ClientScript.RegisterHiddenField("txthidLoginID1", "XYZ");
>
> btnSUOK1.Attributes.Add("onclick", "return
> ReturnBook()");
>
> if (!
> ClientScript.IsStartupScriptRegistered("SearchUsers"))
> {
> ClientScript.RegisterStartupScript(this.GetType(),
> "SearchUsers",
> " ");
> }
>
> 2. In our application we are using only one Master page having label
> control
>
> All pages uses Master page
>
>
>
>
> runat="server">
>
>
> 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").FindCon trol("lblHeader").UniqueID];
> lblMasterHeader.Text = "DataChecker - Manage Users";
>
>
>
>
>
Re: ASP.NET 2.0 Modal Dialog Window & Master Page
am 24.01.2008 18:24:59 von mark
"bruce barker" wrote in message
news:0A7FA7D0-195D-4AA8-9AEE-234D8E087379@microsoft.com...
> also you should move away from a modaldialog solution.
Definitely.
> this is an IE only feature
IE and, curiously, Safari for Mac... :-)
> and may be droped as IE becomes more w3c compliant. most site uses a
> floating div to do this feature. the ajaxtoolkit also has a solution.
Yes indeed - extremely simple to set up...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Re: ASP.NET 2.0 Modal Dialog Window & Master Page
am 30.01.2008 18:10:32 von ABHIJIT B
Thanks Bruce.
This is client requirement.Can you let me know How can I change Label
text of Master page in Content page
Thanks in advance.
On Jan 24, 11:49=A0am, bruce barker wrote:
> try:
>
> Books.book_id =3D document.getElementById('<%=3DhdvRowID.ClientID%>').valu=
e;
>
> also you should move away from a modaldialog solution. this is an IE only
> feature and may be droped as IE becomes more w3c compliant. most site uses=
a
> floating div to do this feature. the ajaxtoolkit also has a solution.
>
> -- bruce (sqlwork.com)
>
>
>
> "ABHIJIT B" wrote:
>
> > Kindly help me in following
>
> > 1.In my module, I am using two pages Parent(ManageUser) and Child()
> > page.
>
> > Parentwindowhas textbox and button to open Childwindow
> > Child page opens asdialogwindowas you click on button in Parent
> > page using JavaScript showwmodaldialog().
> > Childwindowhas 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
>
> >
D"/>
>
> > hdvRowID.Value =3D "AB";
>
> > I am not able to access value in JavaScript code so it is giving error
> > while
> > taking value.
>
> > Books.book_id =3D document.getElementById('hdvRowID').value;
>
> > ------------------------------------------------------------ ------------=
---=AD------------------------------------------------
>
> > < Parent page code : >
>
> > if (!ClientScript.IsStartupScriptRegistered("ManageUser"))
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 {
>
> > ClientScript.RegisterStartupScript(this.GetType(), "ManageUser",
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "
ascript> " +
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 " function AddBook() {" =
+
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 " =A0var returnVal =3D '=
'; " +
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 " =A0returnVal =3D
> >window.showModalDialog('SearchUsers.htm', null,'status:no;dialogWidth:
> > 500px; dialogHeight:500px;dialogHide:true;center:yes;help:no',windo w);
> > " +
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "
> > document.getElementById('txtSLoginName').value =3D returnVal.book_id;
> > document.getElementById('txtSFirstName').value =3D returnVal.book_name;
> > " +
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 " return false; }" +
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 " ");
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
> > ------------------------------------------------------------ ------------=
---=AD------------------------------------------------
> > < Child page code : >
>
> > ClientScript.RegisterHiddenField("txthidLoginID1", "XYZ");
>
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 btnSUOK1.Attributes.Add("onclick", "retu=
rn
> > ReturnBook()");
>
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!
> > ClientScript.IsStartupScriptRegistered("SearchUsers"))
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 {
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ClientScript.RegisterStartupScri=
pt(this.GetType(),
> > "SearchUsers",
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 " ");
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
>
> > 2. In our application we are using only one Master page having label
> > control
>
> > All pages uses Master page
>
> >
> > weight:normal" >DataChecker
>
> >
> > runat=3D"server">
> >
>
> > I am trying to change Master page label lblHeader text to Manage User
> > using following code,I am getting error.
>
> > A.
>
> > Label lblMasterHeader =3D (Label)Master.FindControl("lblHeader");
> > lblMasterHeader.Text =3D "DataChecker - Manage Users";
>
> > B.
>
> > Label lblMasterHeader =3D
> > (Label)Master.FindControl("ContentPlaceHolder1").FindControl ("lblHeader"=
);
> > lblMasterHeader.Text =3D "DataChecker - Manage Users";
>
> > C.
>
> > string selectedValue =3D
> > Request.Form[this.FindControl("ContentPlaceHolder1").FindCon trol("lblHea=
der=AD").UniqueID];
> > lblMasterHeader.Text =3D "DataChecker - Manage Users";- Hide quoted text=
-
>
> - Show quoted text -
Re: ASP.NET 2.0 Modal Dialog Window & Master Page
am 30.01.2008 19:00:16 von mark
"ABHIJIT B" wrote in message
news:84886972-1afc-4e20-95cc-3899c6da7620@f10g2000hsf.google groups.com...
> Can you let me know how can I change Label
> text of Master page in Content page
You would typically create a property on the MasterPage and set it from the
content page.
On Jan 30, 1:00=A0pm, "Mark Rae [MVP]" wrote:
> "ABHIJIT B" wrote in message
>
> news:84886972-1afc-4e20-95cc-3899c6da7620@f10g2000hsf.google groups.com...
>
> > Can you let me know how can I change Label
> > text of Master page in Content page
>
> You would typically create a property on the MasterPage and set it from th=
e
> content page.
>
> Alternatively, you might just be able to do:
>
> ((Label)Master.FindControl("MyLabel")).Text =3D "Hello";
>
> depending on how your MasterPage is constructed, though I would personally=
> favour the property method...
>
> --
> Mark RaeASP.NETMVPhttp://www.markrae.net
Re: ASP.NET 2.0 Modal Dialog Window & Master Page
am 31.01.2008 19:55:45 von mark
"ABHIJIT B" wrote in message
news:c5788987-0ba3-4f10-880c-4557897d23e3@m34g2000hsf.google groups.com...
Thanks Mark
> Can you suggest mistake I am making in below code,
I certainly can...
>
> style="font-weight:normal" >DC Application
That's an HTMLControl, not a WebControl, so it won't run server-side. Change
it to an WebControl, or add runat="server"...
On Jan 31, 1:55=A0pm, "Mark Rae [MVP]" wrote:
> "ABHIJIT B" wrote in message
>
> news:c5788987-0ba3-4f10-880c-4557897d23e3@m34g2000hsf.google groups.com...
> Thanks Mark
>
> > Can you suggest mistake I am making in below code,
>
> I certainly can...
>
> >
> > style=3D"font-weight:normal" >DC Application
>
> That's an HTMLControl, not a WebControl, so it won't run server-side. Chan=
ge
> it to an WebControl, or add runat=3D"server"...
>
> > Label lblMasterHeader =3D (Label)Master.FindControl("lblHeader");
>
> That will only work if you change the