Click here to Skip to main content
15,896,111 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
im getting error in .....


C#
private string Fetchsno(string emailid)
{

}



Error: '_Default.Fetchsno(string)': not all code paths return a value


I want to use this funtion activation url.....
suppose if i have used void datatype means,

im getting error in activation url...

C#
ActivationUrl = Server.HtmlEncode("http://localhost:50059/WebSite1/activate%20account.aspx?sno=" + Fetchsno(emailid) + "&emailid=" + emailid);



error:
VB
Error   16  Operator '+' cannot be applied to operands of type 'string' and 'void'  D:\frm lap\WebSite1\Default.aspx.cs 33  44  D:\frm lap\WebSite1\



Give me your suggestions
Posted
Updated 20-Mar-14 2:09am
v2
Comments
VICK 20-Mar-14 8:10am    
Do Have a look HERE for a similar Task

1 solution

You forgot to return from your function with a string.

C#
private string Fetchsno(string emailid)
{
    return "Here you can add your string.";
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900