Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > eventvalidation razzle dazzle

Reply
Thread Tools

eventvalidation razzle dazzle

 
 
=?Utf-8?B?RG9rZXI=?=
Guest
Posts: n/a
 
      07-04-2007
Hello.

I've go a little userwebcontrol that has a button. Tis button when clicked
hides a label and shows a textbox in its place ([code 1]).

Works fine until i put it in a datalist or similiar thing. As you could
expect, or may be you shouldn't, Asp shouts something about event validation.
We all know what it is but the question is how should this object or/and this
event be registred to work correctly.

I know what to do when there is an extra position in combox or similary
(---code-- Page.ClientScript.RegisterForEventValidation(
this.UniqueID,
"4"
);
---/end code ---)
but what with that event.

I even tried [code 2] in the control.
What can i do?

---code 1
<asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline">
<ContentTemplate>
<asp:Literal ID="LiteralTresci" runat="server" Mode="PassThrough"
EnableViewState="False"
Text="[Lokalizowany
Literal]"></asp:Literal><asp:ImageButton ID="EditButton"
runat="server" SkinID="PrzyciskEdycji"
OnClick="EditButton_Click" EnableViewState="false"
Visible="False" CausesValidation="False" />
<table runat="server" id="KontenerEdycji" visible="false"
style="border-collapse: collapse;
margin: 0; padding: 0; background-color: #ffff99; color: Black;
font-size: 10px;">
<tr>
<td style="height: 26px">
<asp:TextBox ID="EditTextBox" runat="server"
EnableViewState="False"></asp:TextBox>
<asp:LinkButton ID="AcceptBtn" runat="server"
OnClick="AcceptBtn_Click" CausesValidation="False">Apply</asp:LinkButton>
<asp:LinkButton ID="CancelBtn" runat="server"
OnClick="CancelBtn_Click" CausesValidation="False">Cancel</asp:LinkButton>

</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
---/end code 1


---code 2

void Register(Control ct)
{
foreach (Control c in ct.Controls)
{

this.Page.ClientScript.RegisterForEventValidation( c.UniqueID.ToString());
Register(c);
}


}

protected override void Render(HtmlTextWriter writer)
{
Register(this);
base.Render(writer);
}

---/end code 2

 
Reply With Quote
 
 
 
 
=?Utf-8?B?RG9rZXI=?=
Guest
Posts: n/a
 
      07-04-2007
I figured out that the problem occures only when DataBind() is called.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XP driver for Dazzle USB Zknb Computer Support 3 08-11-2008 01:38 PM
EventValidation Parser Error Dave ASP .Net 1 10-25-2007 04:00 PM
BUG: Asp.Net2 EventValidation + DataGrid + PushButton Error . DotQuery ASP .Net 0 05-24-2006 01:18 AM
Eventvalidation, bug or annoyance ? PL ASP .Net 0 11-14-2005 04:31 PM
Dazzle Zio Portable Compact Flash Card Reader/Writer? John Computer Support 1 01-06-2005 02:59 PM



Advertisments