Click here to Skip to main content
15,910,212 members

Comments by jaipal0908 (Top 26 by date)

jaipal0908 13-Jun-12 10:56am View    
Thank you
jaipal0908 13-Jun-12 8:51am View    
I converted the code from VB to C# like below..

VB Code:
MultiView1.ActiveViewIndex = Int32.Parse(e.Item.Value)
Dim i As Integer
'Make the selected menu item reflect the correct imageurl
For i = 0 To Menu1.Items.Count - 1
If i = e.Item.Value Then
Menu1.Items(i).ImageUrl = "selectedtab.gif"
Else
Menu1.Items(i).ImageUrl = "unselectedtab.gif"
End If
Next


C# code:

MultiView1.ActiveViewIndex = Int32.Parse(e.Item.Value);
for (int i = 0; i < Menu1.Items.Count-1;i++)
{
if(i=e.Item.Value)
{
Menu1.Items[i].ImageUrl = "selectedtab.gif";
}
else
{
Menu1.Items[i].ImageUrl = "unselectedtab.gif";
}
}




But still i am getting this error near "i=e.Item.Value"
CS0019: Operator '==' cannot be applied to operands of type 'int' and 'string'

Can anyone help me...
jaipal0908 13-Jun-12 3:05am View    
No web service,in client machine i have to host.
jaipal0908 12-Jun-12 3:16am View    
Hi VJ,

In the above converted code i am getting the error like this.
Compiler Error Message: CS0019: Operator '==' cannot be applied to operands of type 'int' and 'string'

Source Error:



Line 21: for (int i = 0; i < Menu1.Items.Count; i++)
Line 22: {
Line 23: if (i == e.Item.Value)---------Here Error coming
Line 24: {
Line 25: Menu1.Items[i].ImageUrl = "selectedtab.gif";
jaipal0908 11-Jun-12 11:04am View    
Thank you,but i am getting error at void after conversion in line
protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
at void