.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Returning function value in c#.net

Posted By: Naresh     Posted Date: August 05, 2010    Points:2   Category :ASP.Net
Hi,

I need to pass a value to a function and make changes and bring the value to button click.

Eg:

In button click event:

name="Abcdefgh"; //say
replace(name); //calling function




public string replace(string aaa)
{
aaa=aaa.replace("A","1")
return aaa;
}


now i want to use the value of aaa in button click

how to return the value to button click?




Thank u in advance

Responses
Author: Syed Shakeer Hussain             
Posted Date: August 05, 2010     Points: 5   

Hi,
String name="Abcdefgh";



public string replace(string name)
{
String result=name.replace("A","1")
return result;

}


In Button Click :-
--------------
String str=replace(name);
(OR)
lablel1.Text=replace(name);


Author: Naresh             
Posted Date: August 05, 2010     Points: 5   

Hi Hussain ,


Thank u for ur reply.

The code is working

Thanks
Naresh
Author: Syed Shakeer Hussain             
Posted Date: August 05, 2010     Points: 5   

Hi Naresh,

Welcome .



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend