Click here to Skip to main content
15,908,768 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionregarding webserver & database server & web application execution flow Pin
vijaylumar1-Apr-11 22:26
vijaylumar1-Apr-11 22:26 
QuestionProblem in displaying data. Pin
manikumar_gutti1-Apr-11 19:55
manikumar_gutti1-Apr-11 19:55 
AnswerRe: Problem in displaying data. Pin
Wendelius2-Apr-11 2:22
mentorWendelius2-Apr-11 2:22 
Questionabout chating application Pin
avanishkri1-Apr-11 5:00
avanishkri1-Apr-11 5:00 
AnswerRe: about chating application Pin
Dave Calkins1-Apr-11 6:38
Dave Calkins1-Apr-11 6:38 
AnswerRe: about chating application Pin
Parwej Ahamad1-Apr-11 8:00
professionalParwej Ahamad1-Apr-11 8:00 
AnswerRe: about chating application Pin
RaviRanjanKr6-Apr-11 20:01
professionalRaviRanjanKr6-Apr-11 20:01 
QuestionRetrieve the value of a control of the master page Pin
amina891-Apr-11 0:44
amina891-Apr-11 0:44 
Hello;
In the master page of my site I have a textbox that displays the school year, to recover the value of textbox in other pages I used:
page.master.cs
protected void Page_Load(object sender, EventArgs e)<br />
    {<br />
        Label13.Text = Convert.ToString(DateTime.Now);<br />
        //  SqlConnection maConnexionSQLsrv = new SqlConnection(@"Data Source=.\SQLEXPRESS;UID=sa;Password=forChariaa3*;Initial Catalog=scolarite");<br />
        SqlConnection myConnection = new SqlConnection(ConnectionString);<br />
        myConnection.Open();<br />
<br />
<br />
        String maRequete = "select ann_uni as [p1]from annee where @param between date_debut and date_fin";<br />
        SqlCommand myCommand = new SqlCommand(maRequete, myConnection);<br />
        myCommand.Parameters.Add(new SqlParameter("@param", SqlDbType.DateTime));<br />
        myCommand.Parameters["@param"].Value = Label13.Text;<br />
        SqlDataReader drr2 = myCommand.ExecuteReader();<br />
<br />
<br />
        while (drr2.Read())<br />
        {<br />
            Textbox1.Text = drr2["p1"].ToString();<br />
        }<br />
        drr2.Close();<br />
<br />
    }<br />
    private string ConnectionString<br />
    {<br />
        get<br />
        {<br />
            string connectionString = (@"Data Source=.\SQLEXPRESS;UID=sa;Password=*****;Initial Catalog=bd1");<br />
<br />
            // string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;<br />
            return connectionString;<br />
        }<br />
    }<br />
    public string ContentTextBoxOfMasterPage<br />
    {<br />
        get { return Textbox1.Text; }<br />
    }

defaul2.aspx
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" Title="Page sans titre" %><br />
<%@ MasterType  virtualPath="~/MasterPage.master"%><br />
 <br />
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"><br />
</asp:Content><br />
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"><br />
    <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox></asp:Content><br />

Default2.aspx.cs
protected void Page_Load(object sender, EventArgs e)<br />
    {<br />
        TextBox2.Text = Master.ContentTextBoxOfMasterPage;<br />
    }

MasterPage.master
<asp:TextBox ID="Textbox1" runat="server"></asp:TextBox><br />
       <br />
        <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server"><br />
        </asp:ContentPlaceHolder><br />
    </div><br />
    </form><br />
</body><br />
</html><br />

But TextBox2 is empty.
thank you
AnswerRe: Retrieve the value of a control of the master page Pin
Not Active1-Apr-11 1:05
mentorNot Active1-Apr-11 1:05 
GeneralRe: Retrieve the value of a control of the master page Pin
amina891-Apr-11 2:11
amina891-Apr-11 2:11 
GeneralRe: Retrieve the value of a control of the master page Pin
Not Active1-Apr-11 2:29
mentorNot Active1-Apr-11 2:29 
AnswerRe: Retrieve the value of a control of the master page Pin
gr33d1-Apr-11 4:53
gr33d1-Apr-11 4:53 
GeneralRe: Retrieve the value of a control of the master page Pin
amina894-Apr-11 12:08
amina894-Apr-11 12:08 
AnswerRe: Retrieve the value of a control of the master page Pin
Prasanta_Prince14-Apr-11 1:10
Prasanta_Prince14-Apr-11 1:10 
Questionproblem in displaying the data in datagrid` Pin
manikumar_gutti31-Mar-11 23:14
manikumar_gutti31-Mar-11 23:14 
AnswerRe: problem in displaying the data in datagrid` Pin
Deshpande.anagha1-Apr-11 0:43
Deshpande.anagha1-Apr-11 0:43 
AnswerRe: problem in displaying the data in datagrid` Pin
ktrrzn5-Apr-11 15:18
ktrrzn5-Apr-11 15:18 
QuestionCaptcha and Client IP Pin
Priya Prk31-Mar-11 22:57
Priya Prk31-Mar-11 22:57 
AnswerRe: Captcha and Client IP Pin
L Viljoen31-Mar-11 23:09
professionalL Viljoen31-Mar-11 23:09 
QuestionA login problem Pin
Farhad Eft31-Mar-11 20:49
Farhad Eft31-Mar-11 20:49 
AnswerRe: A login problem Pin
Venkatesh Mookkan31-Mar-11 21:01
Venkatesh Mookkan31-Mar-11 21:01 
GeneralRe: A login problem Pin
Farhad Eft31-Mar-11 21:24
Farhad Eft31-Mar-11 21:24 
AnswerRe: A login problem Pin
C#Coudou31-Mar-11 21:02
C#Coudou31-Mar-11 21:02 
GeneralRe: A login problem Pin
Farhad Eft31-Mar-11 21:23
Farhad Eft31-Mar-11 21:23 
GeneralRe: A login problem Pin
Farhad Eft31-Mar-11 21:26
Farhad Eft31-Mar-11 21:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.