hey guys. i have search alot to find a way how to pass multiple values through javascript to asp.net api, but couldn't find the better answer. please help me out how to do that.
Thanks in advance
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Iftikar HussainPosted Aug 2, 2013, 2:11 PM
";
saifullah khanPosted Aug 2, 2013, 2:37 PM
Iftikar HussainPosted Aug 2, 2013, 2:33 PM
Regards,
Iftikar
saifullah khanPosted Aug 2, 2013, 2:12 PM
Iftikar HussainPosted Aug 2, 2013, 2:10 PM
Regards,
Iftikar
saifullah khanPosted Aug 2, 2013, 2:08 PM
Iftikar HussainPosted Aug 2, 2013, 2:03 PM
Regards,
Iftikar
saifullah khanPosted Aug 2, 2013, 1:59 PM
Iftikar HussainPosted Aug 2, 2013, 1:54 PM
Regards,
Iftikar
saifullah khanPosted Aug 2, 2013, 1:52 PM
Iftikar HussainPosted Aug 2, 2013, 1:52 PM
Regards,
Iftikar
Iftikar HussainPosted Aug 2, 2013, 1:49 PM
";
Iftikar
saifullah khanPosted Aug 2, 2013, 1:40 PM
Iftikar HussainPosted Aug 2, 2013, 1:32 PM
Regards,
Iftikar
saifullah khanPosted Aug 2, 2013, 1:20 PM
thanks for your help
Iftikar HussainPosted Aug 2, 2013, 1:16 PM
[WebMethod]
public string SaveData(string title, string songPath)
{
string appPath =@"C:\";
string filePath = appPath + "txt.txt";
StreamWriter w;
w = File.CreateText(filePath);
w.WriteLine(title);
w.WriteLine(songPath);
w.Flush();
w.Close();
// Label1.Text = "File created and write successfully!
";
// Label1.Text += filePath;
return null;
}
Regards,
Iftikar
saifullah khanPosted Aug 2, 2013, 1:10 PM
Iftikar HussainPosted Aug 2, 2013, 12:49 PM
Regards,
Iftikar
saifullah khanPosted Aug 2, 2013, 12:41 PM
here is my Default2.aspx.cs page
protected void Page_Load(object sender, EventArgs e)
{
}
[WebMethod]
public string SaveData(string title, string songPath)
{
string appPath =HttpContext.Current.Server.MapPath(PhysicalApplicationPath);
string filePath = appPath + "txt.txt";
StreamWriter w;
w = File.CreateText(filePath);
w.WriteLine(title);
w.WriteLine(songPath);
w.Flush();
w.Close();
// Label1.Text = "File created and write successfully!
";
// Label1.Text += filePath;
return null;
}
public string PhysicalApplicationPath { get; set; }
kindly tell me whats wrong
Iftikar HussainPosted Aug 2, 2013, 12:10 PM
You can use Jquery Ajax to pass multiple values, like this
Regards,
Iftikar