|
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")
|
|
|
|
|
hi guys i want to show advertisemnts in to my page...,
my clients giving the advertisements like script,html,images,flash...,
now my probs is suppose in my banner i want to show a advertisemnt...,
for example my banner advertisement file type's are script file and images...,
how to show diff kind of files in the same place with adrotation?
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
Actually i a have a treeview with context menu.when user select Add new item from context menu a window open having textbox and button.I want value of Treeview.selectedNode.Text ,in this new window.How can i do this tell me please.
|
|
|
|
|
Are you opening a modal dialog window?
|
|
|
|
|
Hi all,
I have build a website and running it successfuly.
after that i tried to publish(published all ASPX pages and dll's) this project on server.
it also done successfully. but when access a page it is throwing an error like aaa.aspx.cs file not found. this file exists in a folder of my project. in my local machine it is working fine. after publishing i am getting this error.
can any one help me in that how to run this page.
fttyhtrhyfytrytrysetyetytesystryrty
|
|
|
|
|
Hi, I have datalist which is inside a rounded cornered table. How can I reuse the table for multiple datalists without recreating the table every time..i.e table, tr, td.....
I was thinking about a custom datalist control but I don't know how to do it.
Any help appreciated.
Thank you.
|
|
|
|
|
Albert83 wrote: I have datalist which is inside a rounded cornered table
I think UserControl suits your requirement.Just think about a usercontrol.
|
|
|
|
|
Thanks. But how would I embed a general datalist inside the table? and then reuse it. The datalist id and contents will be different on various pages. The table is the same.
|
|
|
|
|
Make a usercontrol and embed the datalist inside the table.Thats all.Just try.
|
|
|
|
|
Ok. I will try seems to be pretty simple. Thanks.
|
|
|
|
|
I have a grid view, I set the cells' back-color of this grid view by javascript code(on right-mouse-click). When I hit a submit button, the page refreshes and the cells' color becomes white again.
I find a way to save the color of any cell before the refresh of the page.
|
|
|
|
|
You need to use a hidden field, or similar, to pass the value in question back to the code behind, and then write code to restore that value.
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 know how to pass values to code behind. but how can I know what cell was clicked? the grid view cell has no position or index property..
|
|
|
|
|
Hi Everybody
i want to upload my website in local server then it showing error this type-
a name was started with an invalid character. error processing resource 'http localhost
how we solve this types of error plz help me.
thanks and regards
vivek
|
|
|
|
|
A better and quick way to troubleshoot such errors are by searching[^].
|
|
|
|
|
Hi,
How to display the data from database as slide show.
Eg:
There is 20 rows of data in database, i need to show the first 5 in first 10 seconds, next 5 in next 10 seconds... and go on by displaying each 5 data per 10 seconds.
Is there any .net control to show such condition?
Thankyou,
YPKI
|
|
|
|
|
You would need to use AJAX, or at least a javascript timer, to do this. I doubt there's any control for it out of the box, but you never know.
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.
|
|
|
|
|
Hello,
I have an ASP.NET website with a sql backend. I am utilizing the membership provider model within visual studio. The site can only be accessed by entering the correct username and password.
I have approximately 20 pdfs on the website. I need to be keep a log of who has "read" which documents. I am creating a page that lists all documents to be read. I have a check box before each url. The user will need to check off which documents he/she has read and then submit the page. When the user clicks on the link again to see the remaining documents to be read, the page should only display those documents that the user has not yet checked off.
I can store the document list in a sql database but I am not certain how to maintain the log of documents for each user and how to only display the list of those documents that have not yet been read.
Any thoughts or assistance would be appreciated. Also if there is more efficient way to do this please let me know.
Thank you in advance for your assistance.
Allison
|
|
|
|
|
This sounds messy to me. If I check an item, it disappears from the list ? I would have thought you would allow users to request a document they have viewed before, and that you'd track what they read automatically, through what documents they requested from your system.
I would expect you're going to store in the DB which ones were marked read, then run SQL to request the unread ones to view.
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.
|
|
|
|
|
Christian,
Thanks for your quick reply. You bring up a good point, I see that I probably did not clarify this as well as I should.
The list of documents that need to be read is a separate page that serves as a central location to store all those documents that still need to be confirmed as being read (by the user). This list contains the name of the document, a link to the document and checkbox that is to be checked once the document is read. The documents are located on a variety of pages throughout the site.
Hopefully that helps. Sorry for the initial confusion.
Allison
|
|
|
|
|
OK - I still think that you should be detecting when a document is requested, and marking it as read as a result, and letting the user view ALL documents in order to select which ones to mark as read ( so they can unmark some ). From there, if you have them marked as read in the DB, it's easy to write SQL that returns the list of unread documents, so you can display that.
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.
|
|
|
|
|
Christian,
Thanks that makes perfect sense, however (per the requirements provided to me), I need for the user to actually check a box or something to confirm that they have read the document. I really appreciate your help.
Allison
|
|
|
|
|
Has anyone gone over the requirements with the client, or are they allowed to invent anything and you're not allowed to offer feedback ?
In any case, you can do this easy enough, just define a column that has a checkbox in a gridview that you display, then check which ones were checked, on postback.
http://www.codeproject.com/info/search.aspx?artkw=gridview+checkbox[^]
There seems to be a lot of CP articles on how to use checkboxes inside a gridview, I'd say you need to start there. It's a while since I've done this sort of thing, and I am sure that an article with downloadable code will help you more than any comments I might make in a forum reply.
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.
|
|
|
|