|
Hi All,
I have a image button. I would like to call client side function as well as server side function in same button in same time.
remember I don't want to call any javascript confirmation.
Need yours advice....
|
|
|
|
|
vnsraj wrote: I would like to call client side function
vnsraj wrote: remember I don't want to call any javascript confirmation.
You just can't do it. You CAN call client side methods BEFORE calling the server, but, by definition, it has to be javascript. What else could it be ? Do you know what it is you're asking ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
vnsraj wrote: remember I don't want to call any javascript confirmation.
what you mean exactly?
Your question is not clear.
BTW use OnClientClick for adding client method and OnClick for server side code.
|
|
|
|
|
I have a image button, I want to called a server side function in image button onclick function on same time I want to called a javascript function.
|
|
|
|
|
Its possible to inject javascript snippets using ScriptManager.RegisterStartupScript .
Why you want 2 do that?Actually vat u r trying 2 achieve?
|
|
|
|
|
When I try to open new website in my visual studio it give a massage "no template are found" and open a window but there is no option of selection
|
|
|
|
|
What are you doing exactly ? What version of VS do you have ? Do you get a new project ? Can you add pages to it ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
VS 2.0...actually I try to create a new website(i try to file->new->website or project) same problem also with new project ..but able to add new web page in existing project.
|
|
|
|
|
public partial class _Default : System.Web.UI.Page
{
OleDbConnection oo;
OleDbDataAdapter adp;
DataSet ds;
protected void Page_Load(object sender, EventArgs e)
{
oo = new OleDbConnection(ConfigurationManager.ConnectionStrings["xls"].ConnectionString);
adp = new OleDbDataAdapter("select EID from [Sheet1$]", oo);
if (!IsPostBack)
{
ds = new DataSet();
ViewState["ds"] = ds;
adp.Fill(ds, "sheet1");
GridView1.DataSource = ds;
GridView1.DataBind();
}
else
{
ds = (DataSet)ViewState["ds"];
GridView1.DataSource = ds;
}
}
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
int pos = e.RowIndex;
string name = ((TextBox)GridView1.Rows[pos].Cells[1].Controls[0]).Text;
ds.Tables[0].Rows[pos][0] = name;
ds.AcceptChanges();
GridView1.EditIndex = -1;
GridView1.DataBind();
}
protected void Button1_Click(object sender, EventArgs e)
{
adp = new OleDbDataAdapter("select EID from [Sheet1$]", oo);
OleDbCommandBuilder xx = new OleDbCommandBuilder(adp);
adp.Update(ds, "sheet1");
}
----------------------------------------------
In the above code,
In page_load: Reading from excel. It works fine. Gridview is bind with that. Works fine.
update the date in gridview(working in disconnected mode). Row_updating works fine.
Now want to transfer the data from disconnected excel to same excel in connected mode (written under button1_click).
Data is not getting pdated in connected excel.
Why?
|
|
|
|
|
Why do you want to pass data between excel sheets in a webpage ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Requirement is to map a excel sheet data to gridview in ASP.NET.
Make changes to excel using gridview in disconnected mode.
After that, transfer the chnages to same excel in connected mode.
|
|
|
|
|
Hi ,
two notepad are running one is saved as first.txt other is saved as second.txt how to kill only one process first.txt
I am using the following code which is closing all the notepad
foreach (Process pre in Process.GetProcesses())
{
if (pre.ProcessName.StartsWith("notepad"))
{
pre.Kill();
}
}
Regards,
Amit Patel
|
|
|
|
|
1 - you're an idiot
2 - you got your answer when you asked in the right forum, so why ask in a forum that has nothing to do with your question ?
3 - see 1.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
i don't think thats possible .. all notepad instances use the same process
|
|
|
|
|
Hi all,
I am trying to add a pop calender in content page...
guide me or send some code.
thnks in advance
|
|
|
|
|
Have you read the documentation ? What have you tried ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
Dear ,I M using vs 2005 thanks............
|
|
|
|
|
So ? Do you have ASP.NET AJAX installed ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Yes, but here there is no radimate caleder control like vs 2008 thanks for reply.....
|
|
|
|
|
Well, to be honest, I have always written my own AJAX code. I don't know what comes with 2005, and what you'd need to write yourself. Perhaps the time has come to do some actual programming instead of just trying to cut and paste together whatever Microsoft writes for you ? Or perhaps you should move to VS2008 ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
I am showing a grid on a page having a list of Orders, which is refreshing automatically without postback. The problem occurs while number of store users are logged in.
Problem is after few miniutes log into that page, grid(table) contents on the page which listing the order is swapping/switching among the users.
When a request send by client-1 to the server, the server sending back response of client-1's request to client-2 and vice-versa.
Code in JS:
function FetchDGContentsxyz(lsUser)
{
var lsFilter=document.getElementById('ddlFilter').value;
var lsSort=document.getElementById('ddlSort').value;
this.requestUrl = "AjaxServer.aspx?Usr="+ encodeURIComponent(lsUser) +"&Ftr=" + encodeURIComponent(lsFilter) + "&Srt="+ encodeURIComponent(lsSort);
//CreateXmlReq();
this.Xml1 = new ActiveXObject("Msxml2.XMLHTTP");
if(Xml1)
{
this.Xml1.open("GET", this.requestUrl, true);
this.Xml1.onreadystatechange = HandleResponse;
this.Xml1.send();
}
}
function HandleResponse()
{
if(this.Xml1.readyState == 4)
{
if(this.Xml1.status == 200)
{
ClearTable();
FillTable(this.Xml1.responseXML.documentElement);
}
else
{
alert("There was a problem retrieving data from the server." );
}
}
}
code in AjaxServer :
If Not IsPostBack Then
UserName = Request("Usr")
Filter = Request("Ftr")
Sort = Request("Srt")
Response.Clear()
If Filter = "All Location" Then
Filter = ""
Else
Filter = " and b.LocNo='" & Filter & "'"
End If
lsSQL = " select row_number() over (order by " & Sort & ")[Sl.], a.orderno [Order No],a.updatedtime [Time], " from order_temp a INNER JOIN Location b ON a.ALocNo = b.LocNo INNER JOIN tbl_OrderStatus c ON a.status = c.STS_Code INNER JOIN customer d ON a.custcode = d.custid LEFT OUTER JOIN driver e ON a.deliveredby = e.driverid LEFT OUTER JOIN tbl_storeTiming f ON a.ALocNo=f.locno and datename(w,a.updatedon)=f.weekday " & _
" where a.alocno in (select locno from Tbl_StoreRights where loginid='" & UserName & "') " lsSQL = lsSQL & Filter & " order by " & Sort
ds = GenDataTable(lsSQL, "Order_temp")
chString = ds.GetXml()
Response.Expires = -1
Response.Clear()
Response.ContentType = "text/xml"
Response.Write(chString)
'Response.Flush()
Response.End()
Else
Response.Clear()
Response.End()
End If
End Sub
|
|
|
|
|
Your code needs to identify the user on the postback, probably with a session variable.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
session variable is used you can the same in session("name")
|
|
|
|