Friday, March 16, 2012

Populating a text field and then getting its value

If I change the textbox property Readonly to false then it works perfectly
fine. I am using the latest Beta 2 release of .net framework.
Imran.

"Grant Merwitz" <grant@dotnet.itags.org.workshare.com> wrote in message
news:O0YmSUcmFHA.576@dotnet.itags.org.TK2MSFTNGP15.phx.gbl...
> Thats a strange one.
> Working fine for me:
> ASPX:
> <asp:TextBox id="TextBox1" runat="server" ReadOnly="True"
> OnClick="Button1_Click"></asp:TextBox>
> <asp:Button id="Button1" runat="server" Text="Button"></asp:Button>
> CS
> void Page_Load(object sender, System.EventArgs e)
> {
> if(!Page.IsPostBack)
> TextBox1.Text = "Hello";
> }
> void Button1_Click(object sender, System.EventArgs e)
> {
> Response.Write("Value: " + TextBox1.Text);
> }
> OUTPUT
> Value: Hello
>
> Try making a simple page like that and testing it
>
> "Imran Aziz" <imran@dotnet.itags.org.tb2.net> wrote in message
> news:e43rNIcmFHA.2860@dotnet.itags.org.TK2MSFTNGP15.phx.gbl...
>> Hello All,
>> I am populating a text field dynamic in my code, and its a read-only
>> textbox control. It populates it perfectly fine. but when I get its value
>> back in code I get an empty string any clues as to how to get this sorted
>> please ?
>>
>> Here is how I set the value of the control.
>> txtTitle.Text = feed.Channels[0].Title;
>>
>> and get it later
>>
>> String strString = txtTitle.Text;
>>
>> Any clues please ?
>>
>> Imran.
>>okay, i'm on v1.1

I have beta 2 on a machine here.
If i have time to test it before i go, i'll try run the example there

"Imran Aziz" <imran@.tb2.net> wrote in message
news:%23rwRZUdmFHA.2860@.TK2MSFTNGP15.phx.gbl...
> If I change the textbox property Readonly to false then it works
> perfectly fine. I am using the latest Beta 2 release of .net framework.
> Imran.
> "Grant Merwitz" <grant@.workshare.com> wrote in message
> news:O0YmSUcmFHA.576@.TK2MSFTNGP15.phx.gbl...
>> Thats a strange one.
>> Working fine for me:
>>
>> ASPX:
>>
>> <asp:TextBox id="TextBox1" runat="server" ReadOnly="True"
>> OnClick="Button1_Click"></asp:TextBox>
>> <asp:Button id="Button1" runat="server"
>> Text="Button"></asp:Button>
>>
>> CS
>>
>> void Page_Load(object sender, System.EventArgs e)
>> {
>> if(!Page.IsPostBack)
>> TextBox1.Text = "Hello";
>> }
>>
>> void Button1_Click(object sender, System.EventArgs e)
>> {
>> Response.Write("Value: " + TextBox1.Text);
>> }
>>
>> OUTPUT
>>
>> Value: Hello
>>
>>
>> Try making a simple page like that and testing it
>>
>>
>> "Imran Aziz" <imran@.tb2.net> wrote in message
>> news:e43rNIcmFHA.2860@.TK2MSFTNGP15.phx.gbl...
>>> Hello All,
>>> I am populating a text field dynamic in my code, and its a read-only
>>> textbox control. It populates it perfectly fine. but when I get its
>>> value back in code I get an empty string any clues as to how to get this
>>> sorted please ?
>>>
>>> Here is how I set the value of the control.
>>> txtTitle.Text = feed.Channels[0].Title;
>>>
>>> and get it later
>>>
>>> String strString = txtTitle.Text;
>>>
>>> Any clues please ?
>>>
>>> Imran.
>>>
>>
>>
Thanks a lot.
Imran.
"Grant Merwitz" <grant@.workshare.com> wrote in message
news:u9$zKbdmFHA.3936@.TK2MSFTNGP10.phx.gbl...
> okay, i'm on v1.1
> I have beta 2 on a machine here.
> If i have time to test it before i go, i'll try run the example there
> "Imran Aziz" <imran@.tb2.net> wrote in message
> news:%23rwRZUdmFHA.2860@.TK2MSFTNGP15.phx.gbl...
>> If I change the textbox property Readonly to false then it works
>> perfectly fine. I am using the latest Beta 2 release of .net framework.
>> Imran.
>>
>> "Grant Merwitz" <grant@.workshare.com> wrote in message
>> news:O0YmSUcmFHA.576@.TK2MSFTNGP15.phx.gbl...
>>> Thats a strange one.
>>> Working fine for me:
>>>
>>> ASPX:
>>>
>>> <asp:TextBox id="TextBox1" runat="server" ReadOnly="True"
>>> OnClick="Button1_Click"></asp:TextBox>
>>> <asp:Button id="Button1" runat="server"
>>> Text="Button"></asp:Button>
>>>
>>> CS
>>>
>>> void Page_Load(object sender, System.EventArgs e)
>>> {
>>> if(!Page.IsPostBack)
>>> TextBox1.Text = "Hello";
>>> }
>>>
>>> void Button1_Click(object sender, System.EventArgs e)
>>> {
>>> Response.Write("Value: " + TextBox1.Text);
>>> }
>>>
>>> OUTPUT
>>>
>>> Value: Hello
>>>
>>>
>>> Try making a simple page like that and testing it
>>>
>>>
>>> "Imran Aziz" <imran@.tb2.net> wrote in message
>>> news:e43rNIcmFHA.2860@.TK2MSFTNGP15.phx.gbl...
>>>> Hello All,
>>>> I am populating a text field dynamic in my code, and its a read-only
>>>> textbox control. It populates it perfectly fine. but when I get its
>>>> value back in code I get an empty string any clues as to how to get
>>>> this sorted please ?
>>>>
>>>> Here is how I set the value of the control.
>>>> txtTitle.Text = feed.Channels[0].Title;
>>>>
>>>> and get it later
>>>>
>>>> String strString = txtTitle.Text;
>>>>
>>>> Any clues please ?
>>>>
>>>> Imran.
>>>>
>>>
>>>
>>
>>
Sorry it took me so long to try this.

But it's working fine for me on a Machine running Beta 2

"Imran Aziz" <imran@.tb2.net> wrote in message
news:ujgDxxdmFHA.2472@.TK2MSFTNGP15.phx.gbl...
> Thanks a lot.
> Imran.
> "Grant Merwitz" <grant@.workshare.com> wrote in message
> news:u9$zKbdmFHA.3936@.TK2MSFTNGP10.phx.gbl...
>> okay, i'm on v1.1
>>
>> I have beta 2 on a machine here.
>> If i have time to test it before i go, i'll try run the example there
>>
>> "Imran Aziz" <imran@.tb2.net> wrote in message
>> news:%23rwRZUdmFHA.2860@.TK2MSFTNGP15.phx.gbl...
>>> If I change the textbox property Readonly to false then it works
>>> perfectly fine. I am using the latest Beta 2 release of .net framework.
>>> Imran.
>>>
>>> "Grant Merwitz" <grant@.workshare.com> wrote in message
>>> news:O0YmSUcmFHA.576@.TK2MSFTNGP15.phx.gbl...
>>>> Thats a strange one.
>>>> Working fine for me:
>>>>
>>>> ASPX:
>>>>
>>>> <asp:TextBox id="TextBox1" runat="server" ReadOnly="True"
>>>> OnClick="Button1_Click"></asp:TextBox>
>>>> <asp:Button id="Button1" runat="server"
>>>> Text="Button"></asp:Button>
>>>>
>>>> CS
>>>>
>>>> void Page_Load(object sender, System.EventArgs e)
>>>> {
>>>> if(!Page.IsPostBack)
>>>> TextBox1.Text = "Hello";
>>>> }
>>>>
>>>> void Button1_Click(object sender, System.EventArgs e)
>>>> {
>>>> Response.Write("Value: " + TextBox1.Text);
>>>> }
>>>>
>>>> OUTPUT
>>>>
>>>> Value: Hello
>>>>
>>>>
>>>> Try making a simple page like that and testing it
>>>>
>>>>
>>>> "Imran Aziz" <imran@.tb2.net> wrote in message
>>>> news:e43rNIcmFHA.2860@.TK2MSFTNGP15.phx.gbl...
>>>>> Hello All,
>>>>> I am populating a text field dynamic in my code, and its a
>>>>> read-only textbox control. It populates it perfectly fine. but when I
>>>>> get its value back in code I get an empty string any clues as to how
>>>>> to get this sorted please ?
>>>>>
>>>>> Here is how I set the value of the control.
>>>>> txtTitle.Text = feed.Channels[0].Title;
>>>>>
>>>>> and get it later
>>>>>
>>>>> String strString = txtTitle.Text;
>>>>>
>>>>> Any clues please ?
>>>>>
>>>>> Imran.
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
Hum strange I am doing something wrong then, I guess I will try and use
labels instead of text boxes.
Thanks a lot for coming back to me on that.

Imran
"Grant Merwitz" <grant@.workshare.com> wrote in message
news:eUjjZmNnFHA.3572@.TK2MSFTNGP09.phx.gbl...
> Sorry it took me so long to try this.
> But it's working fine for me on a Machine running Beta 2
>
> "Imran Aziz" <imran@.tb2.net> wrote in message
> news:ujgDxxdmFHA.2472@.TK2MSFTNGP15.phx.gbl...
>> Thanks a lot.
>> Imran.
>> "Grant Merwitz" <grant@.workshare.com> wrote in message
>> news:u9$zKbdmFHA.3936@.TK2MSFTNGP10.phx.gbl...
>>> okay, i'm on v1.1
>>>
>>> I have beta 2 on a machine here.
>>> If i have time to test it before i go, i'll try run the example there
>>>
>>> "Imran Aziz" <imran@.tb2.net> wrote in message
>>> news:%23rwRZUdmFHA.2860@.TK2MSFTNGP15.phx.gbl...
>>>> If I change the textbox property Readonly to false then it works
>>>> perfectly fine. I am using the latest Beta 2 release of .net framework.
>>>> Imran.
>>>>
>>>> "Grant Merwitz" <grant@.workshare.com> wrote in message
>>>> news:O0YmSUcmFHA.576@.TK2MSFTNGP15.phx.gbl...
>>>>> Thats a strange one.
>>>>> Working fine for me:
>>>>>
>>>>> ASPX:
>>>>>
>>>>> <asp:TextBox id="TextBox1" runat="server" ReadOnly="True"
>>>>> OnClick="Button1_Click"></asp:TextBox>
>>>>> <asp:Button id="Button1" runat="server"
>>>>> Text="Button"></asp:Button>
>>>>>
>>>>> CS
>>>>>
>>>>> void Page_Load(object sender, System.EventArgs e)
>>>>> {
>>>>> if(!Page.IsPostBack)
>>>>> TextBox1.Text = "Hello";
>>>>> }
>>>>>
>>>>> void Button1_Click(object sender, System.EventArgs e)
>>>>> {
>>>>> Response.Write("Value: " + TextBox1.Text);
>>>>> }
>>>>>
>>>>> OUTPUT
>>>>>
>>>>> Value: Hello
>>>>>
>>>>>
>>>>> Try making a simple page like that and testing it
>>>>>
>>>>>
>>>>> "Imran Aziz" <imran@.tb2.net> wrote in message
>>>>> news:e43rNIcmFHA.2860@.TK2MSFTNGP15.phx.gbl...
>>>>>> Hello All,
>>>>>> I am populating a text field dynamic in my code, and its a
>>>>>> read-only textbox control. It populates it perfectly fine. but when I
>>>>>> get its value back in code I get an empty string any clues as to how
>>>>>> to get this sorted please ?
>>>>>>
>>>>>> Here is how I set the value of the control.
>>>>>> txtTitle.Text = feed.Channels[0].Title;
>>>>>>
>>>>>> and get it later
>>>>>>
>>>>>> String strString = txtTitle.Text;
>>>>>>
>>>>>> Any clues please ?
>>>>>>
>>>>>> Imran.
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>

0 comments:

Post a Comment