操作数中的问题不适用于object和int [英] problem in operand cant applied to object and int
本文介绍了操作数中的问题不适用于object和int的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图使用这个
I trying to use this
void rptPages_ItemCommand(Object sender, RepeaterCommandEventArgs e)
{
PageNumber = (e.CommandArgument) - 1;
}
Errror
Errror is
Error 1 cannot be applied to operands of type 'object' and 'int' D:\prog\Repeater2\Repeater2\WebForm1.aspx.cs 76 26 Repeater2
推荐答案
尝试:
Try:
void rptPages_ItemCommand(Object sender, RepeaterCommandEventArgs e)
{
if (e.CommandArgument is int)
{
PageNumber = (int) e.CommandArgument - 1;
}
}
这篇关于操作数中的问题不适用于object和int的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文