Click here to Skip to main content
15,914,406 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: ASP.NET Editable Drop Down List Pin
Christian Graus15-May-08 16:00
protectorChristian Graus15-May-08 16:00 
AnswerRe: ASP.NET Editable Drop Down List Pin
Laddie15-May-08 19:43
Laddie15-May-08 19:43 
GeneralRe: ASP.NET Editable Drop Down List Pin
J Liang15-May-08 22:10
J Liang15-May-08 22:10 
QuestionHelp me in choosing the VB.Net Software Pin
avin200315-May-08 8:05
avin200315-May-08 8:05 
AnswerRe: Help me in choosing the VB.Net Software Pin
Blue_Boy15-May-08 10:10
Blue_Boy15-May-08 10:10 
AnswerRe: Help me in choosing the VB.Net Software Pin
Christian Graus15-May-08 11:42
protectorChristian Graus15-May-08 11:42 
Questionasp.net page and sms api. i need help Pin
cmpemikail15-May-08 7:28
cmpemikail15-May-08 7:28 
AnswerRe: asp.net page and sms api. i need help Pin
Christian Graus15-May-08 11:42
protectorChristian Graus15-May-08 11:42 
QuestionAjax enable WCF service Pin
Saurabh15-May-08 5:50
Saurabh15-May-08 5:50 
Questionusing "GridView inline Master/Detail record display" project Pin
Ekjon15-May-08 5:48
Ekjon15-May-08 5:48 
AnswerRe: using "GridView inline Master/Detail record display" project Pin
led mike15-May-08 5:59
led mike15-May-08 5:59 
GeneralRe: using "GridView inline Master/Detail record display" project Pin
Ekjon15-May-08 6:24
Ekjon15-May-08 6:24 
QuestionPDF Pin
Imthu15-May-08 4:01
Imthu15-May-08 4:01 
AnswerRe: PDF Pin
Ernest Laurentin15-May-08 4:28
Ernest Laurentin15-May-08 4:28 
AnswerThird post Pin
leckey15-May-08 4:29
leckey15-May-08 4:29 
Questionhow to create a session for a loging user? Pin
sandy005315-May-08 2:48
sandy005315-May-08 2:48 
AnswerRe: how to create a session for a loging user? Pin
Sandeep Kumar15-May-08 3:05
Sandeep Kumar15-May-08 3:05 
AnswerRe: how to create a session for a loging user? Pin
eyeseetee15-May-08 3:16
eyeseetee15-May-08 3:16 
QuestionPDF component Pin
Imthu15-May-08 2:48
Imthu15-May-08 2:48 
AnswerRe: PDF component Pin
J a a n s15-May-08 4:53
professionalJ a a n s15-May-08 4:53 
QuestionHtmlInputHidden in a datagrid loses it's value after postback [modified] Pin
thomasa15-May-08 2:35
thomasa15-May-08 2:35 
I have a datagrid that contains an HtmlInputHidden, something like:
<asp:datagrid id="dgCurrency" runat="server" CssClass="grid" AllowPaging="False" CellPadding="0"<br />
                                GridLines="Vertical" AutoGenerateColumns="False" ShowFooter="false" ><br />
                                                                <Columns>	<br />
                                    <asp:TemplateColumn HeaderText="ISO kode" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="150px"><br />
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Top"></ItemStyle><br />
                                        <ItemTemplate><br />
                                            <asp:Label id="lblISOCode" runat="server" CssClass="tbStyle1"><br />
                                                <%#DataBinder.Eval(Container.DataItem, "strISOCode").ToString()%>						                        <br />
                                            </asp:Label><br />
                                            <input type="hidden" runat="server" id="inCurrencyID" value='<%#DataBinder.Eval(Container.DataItem, "lngCurrencyID").ToString()%>' />	<br />
                                        </ItemTemplate><br />
                                    </asp:TemplateColumn><br />
...


Where the inCurrencyID is my HtmlInputHidden.

At the first time my page loads, I add a DataView to the dgCurrency datasource.
When I push a button the first time, the inCurrencyID has it's value, as in:
foreach (DataGridItem dgi in dgCurrency.Items)<br />
                {<br />
                    inCurrencyID = (HtmlInputHidden)dgi.FindControl("inCurrencyID");<br />
<br />
                    int lngCurrencyID = int.Parse(inCurrencyID.Value);<br />
...


After this I don't databind the dgCurrency to a new datasource, I just leave it as it is.

Now the next time I push the same button, it has now lost it's value????
The same goes for the label lblISOCode.

The strange thing is that I also have an TextBox in the DataGrid, and that control stil have it's Text.

Dose anyone know why, or is there another hidden fild that I can use that dosen't lose it's value on a PostBack without a databind()?

Thanks
Thomas

modified on Thursday, May 15, 2008 9:47 AM

AnswerRe: HtmlInputHidden in a datagrid loses it's value after postback Pin
TheWirelessGuy15-May-08 9:09
TheWirelessGuy15-May-08 9:09 
QuestionHow to fech records from Dataset Pin
sjs4u15-May-08 2:05
sjs4u15-May-08 2:05 
AnswerRe: How to fech records from Dataset Pin
eyeseetee15-May-08 3:12
eyeseetee15-May-08 3:12 
Questionmessage box problem in code behind Pin
Pankaj Garg15-May-08 1:33
Pankaj Garg15-May-08 1:33 

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.