F
Fabrice
Hello
Is it possible to modify CommandArgument property of a LinkButton from vb
class (code behind).
So, this is my control in my .aspx page :
<asp:LinkButton id="strTd" OnCommand="lnkButtonClick"
enableviewstate="False" CssClass="Detail" Text="Text"
runat="server"></asp:LinkButton>
In my .vb class, i would like to modify the CommandArgument property in the
Sub Page_Load
For Example :
myvar =
Ctype(Server.HtmlEncode((Request.QueryString.GetValues("id")(0))),Integer)
strTd.CommandArgument=myvar .ToString()
But when i select my linkbutton i have the follow error
Format String is incorrect.
Can you help me ?
thanks
fabrice
--- Mesage !
Détails de l'exception: System.FormatException: Le format de la chaîne
d'entrée est incorrect.
Erreur source:
Une exception non gérée s'est produite lors de l'exécution de la demande Web
actuelle. Les informations relatives à l'origine et l'emplacement de
l'exception peuvent être identifiées en utilisant la trace de la pile
d'exception ci-dessous.
Trace de la pile:
[FormatException: Le format de la chaîne d'entrée est incorrect.]
Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value,
NumberFormatInfo NumberFormat) +195
Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String
Value) +97
[InvalidCastException: Cast de la chaîne "" en type 'Integer' non valide.]
Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String
Value) +212
Microsoft.VisualBasic.CompilerServices.IntegerType.FromObject(Object
Value) +750
BehindPatDetails1.lnkButtonClick(Object sender, CommandEventArgs e) +14
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +110
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +115
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +138
System.Web.UI.Page.ProcessRequestMain() +1292
Is it possible to modify CommandArgument property of a LinkButton from vb
class (code behind).
So, this is my control in my .aspx page :
<asp:LinkButton id="strTd" OnCommand="lnkButtonClick"
enableviewstate="False" CssClass="Detail" Text="Text"
runat="server"></asp:LinkButton>
In my .vb class, i would like to modify the CommandArgument property in the
Sub Page_Load
For Example :
myvar =
Ctype(Server.HtmlEncode((Request.QueryString.GetValues("id")(0))),Integer)
strTd.CommandArgument=myvar .ToString()
But when i select my linkbutton i have the follow error
Format String is incorrect.
Can you help me ?
thanks
fabrice
--- Mesage !
Détails de l'exception: System.FormatException: Le format de la chaîne
d'entrée est incorrect.
Erreur source:
Une exception non gérée s'est produite lors de l'exécution de la demande Web
actuelle. Les informations relatives à l'origine et l'emplacement de
l'exception peuvent être identifiées en utilisant la trace de la pile
d'exception ci-dessous.
Trace de la pile:
[FormatException: Le format de la chaîne d'entrée est incorrect.]
Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value,
NumberFormatInfo NumberFormat) +195
Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String
Value) +97
[InvalidCastException: Cast de la chaîne "" en type 'Integer' non valide.]
Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String
Value) +212
Microsoft.VisualBasic.CompilerServices.IntegerType.FromObject(Object
Value) +750
BehindPatDetails1.lnkButtonClick(Object sender, CommandEventArgs e) +14
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +110
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +115
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +138
System.Web.UI.Page.ProcessRequestMain() +1292