Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Having problem using MasterPage in ASP.Net

Posted on 2008-06-19
3
Medium Priority
?
278 Views
Last Modified: 2013-11-26
I have inherited MasterPage in one of asp.net form. I have added some controls in Content box but when I click on Source, I do not see element such as <html>, <head>, <body> and <form> etc..
From this web form, I call another ASP.Net popup form to pick date from calendar and selected date does not transfer to calling form. If I remove MasterPage it works fine because I can see <html>, <head>, <body> and <form> etc.
Any suggestions or solutions?

Thanks.
0
Comment
Question by:siddiqishahid
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 5

Expert Comment

by:scgstuff
ID: 21823297
Do you have an example of what you are trying to pull?  How are you trying to get the value from the popup?  Could you post the code snippet that isn't working in the Master Page, and the same snippet, if different, from the page with the HTML tags.

Thanks,

Shawn
0
 
LVL 33

Accepted Solution

by:
raterus earned 250 total points
ID: 21823354
You're not going to see the <html>,<head>, <body> tags in the content pages.  These are defined in the master page.  If you want to edit them, edit the master page, not the content page!  When the page runs, it's all put together and sent to the browser.
0
 

Author Comment

by:siddiqishahid
ID: 21823898
scgstuff:

Following is code which is working fine without inheriting MasterPage in Form1.aspx

Form1.aspx
--------------

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        &nbsp; &nbsp; &nbsp;
        <asp:TextBox ID="txtDate" runat="server" Style="z-index: 104; left: 40px; position: absolute;
            top: 48px"></asp:TextBox>
            <a href="javascript:;" onclick="window.open('frmCalendar.aspx?myControl=txtDate','cal','width=225,height=200,left=270,top=180')">
        <asp:Image ID="Image1" runat="server" ImageUrl="~/calendar.gif" Style="z-index: 106;
            left: 208px; position: absolute; top: 48px" /></a>
    </div>
    </form>
</body>
</html>


frmCalendar.aspx
--------------------

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Select Date</title>
   
</head>
<body>
    <form id="form2" runat="server">
    <div>
    <asp:Calendar ID="Calendar1" OnSelectionChanged="Change_Date" Runat="server"  >        
    </asp:Calendar>
        &nbsp;&nbsp;&nbsp;
       <input type="hidden" id="myHidden" runat="server" style="width: 127px" />    
    </div>
        &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;
    </form>
</body>
</html>

protected void Page_Load(object sender, EventArgs e)
    {      
        myHidden.Value = Request.QueryString["myControl"].ToString();
    }

protected void Change_Date(object sender, System.EventArgs e)
    {
        string strJScript = "<script>window.opener.document.forms(0)." + myHidden.Value + ".value = '";
        strJScript += Calendar1.SelectedDate.ToString("MM/dd/yyyy") + "';self.close()" + "</" + "script>";
        ClientScript.RegisterClientScriptBlock(this.GetType(), "myScript", strJScript);
    }


0

Featured Post

Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Change in PHP Behavior with Session Write Short Circuit (http://php.net/manual/en/book.session.php#116217) (Winter 2014)** With the release of PHP 5.6 the session handler changed in a way that many think should be considered a bug.  See the note …
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question