|
There seems to be widespread ignorance as to the nature of AJAX. AJAX is basically a way of using features build into the javascript language, the only thing you need is a browser with appropriate js support. ASP.NET has NO AJAX support, none at all. Microsoft has a .NET 2.0 only ( AFAIK ) library which makes it easy to offer AJAX without writing any code, but AJAX itself, is universal.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi guys.
I need help with the code below.Its a database connection with extraction of values from the database.Straight-forward during form-load.Problem is, no values show, and no errors are displayed.
Please help guys.
<%@ Import Namespace="System.Data.OleDb" %>
<%@LANGUAGE="VBSCRIPT" runat="Server" CODEPAGE="1252"%>
sub Page_Load
dim dbconn,sql,dbcomm,dbread
dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & server.mappath("/db/NWIND.mdb"))
dbconn.Open()
sql="SELECT * FROM Customers"
dbcomm=New OleDbCommand(sql,dbconn)
dbread=dbcomm.ExecuteReader()
Customers.DataSource=dbread
Customers.DataBind()
dbread.Close()
dbconn.Close()
end sub
<title>Companyname
<asp:datalist
id="customers"
runat="server"
cellpadding="2"
cellspacing="2"
borderstyle="inset"
backcolor="#e8e8e8"
width="100%"
headerstyle-font-name="verdana"
headerstyle-font-size="12pt"
headerstyle-horizontalalign="center"
headerstyle-font-bold="true"
itemstyle-backcolor="#778899"
itemstyle-forecolor="#ffffff"
footerstyle-font-size="9pt"
footerstyle-font-italic="true">
<headertemplate>
Customers Table
<itemtemplate>
<%#Container.DataItem("Company Name")%> in
<%#Container.DataItem("Address")%>, <%#Container.DataItem("City")%>
<footertemplate>
Source: Northwind Database
kagiso
|
|
|
|
|
Don't use a DataReader, use a datatable or dataset to bind to the control. A datareader will remain open only as long as the database connection. In your case it is being closed almost immediately, which is good. However, using a datareader has the potential to remain open longer than it should, thus reducing the capacity of your site.
only two letters away from being an asset
|
|
|
|
|
I have following error in window service same code is working in window Application
"QueryInterface for interface SQLXMLBULKLOADLib.ISQLXMLBulkLoad failed."
Dim objbl As SQLXMLBulkLoad3
objbl = New SQLXMLBulkLoad3
objbl.ConnectionString = "Provider=SQLOLEDB.1;Data Source=pcDB;Initial Catalog=webdb;User ID=sa;pwd=sa"
objbl.ErrorLogFile = "c:\error.log"
objbl.BulkLoad = True
objbl.KeepIdentity = False
objbl.CheckConstraints = False
objbl.Transaction = False
objbl.Execute("c:\Items.XSD", "C:\Items.xml")
Thanks
Hardik Panchal
|
|
|
|
|
Don't cross post in multiple forums. It's considered very rude to "spam" the forums and makes it quite difficult for multiple people to collaborate on an answer.
|
|
|
|
|
hi ,
i am using asp.net2003 with c#
i need to know how we can invoke a server side function when user click browser close button???
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
You can't.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Handle the Javascript event and call an AJAX method.
only two letters away from being an asset
|
|
|
|
|
is it possible to use AJAX in asp.net 2003
i think we can use page's unload event...
plz tell me some sample site to use ajax in asp.net 2003?..
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
AJAX type techiques have been around since about 1997, they have only recently been named AJAX and come into vogue. It makes use of XMLHttpRequest which is independent from any version ASP.NET.
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: AJAX type techiques have been around since about 1997, they have only recently been named AJAX and come into vogue. It makes use of XMLHttpRequest which is independent from any version ASP.NET.
And even before that similar techniques were used with hidden frames, minimal iframes and small image tags.
---
single minded; short sighted; long gone;
|
|
|
|
|
I've tried to suppress those memories
only two letters away from being an asset
|
|
|
|
|
Ajax is simply a technique that you achieve using Javascript. For what you want you'd need to hook into the body's onunload event and fire a quick request to the server. Of course there is no guarantee that this will ever run, and I'm pretty sure the browser close event is one situation that it won't. Best not to rely on it.
|
|
|
|
|
badgrs wrote: Of course there is no guarantee that this will ever run, and I'm pretty sure the browser close event is one situation that it won't.
Please, elaborate on this. Why would the call never run?
only two letters away from being an asset
|
|
|
|
|
Basically because the page where code is running is already closing. You can hardly do anything there without opening a new window.
---
single minded; short sighted; long gone;
|
|
|
|
|
Strange. I have a project now were I'm calling an ajax method from the onunload script event and it seems to be working fine.
only two letters away from being an asset
|
|
|
|
|
I'll have to go back on what I said as closing the browser will run the code, but there are lots of cases where it won't. For instance, using the browsers back and forward buttons don't cause unload events (so if a user goes back a few pages before closing it won't run.....I don't think....), if the user has disconnected from tinternet, if the browser crashes, if you force quit the browser... It also depends on the browser, certainly IE has different ideas about when to call load events than Firefox.
I'm not saying you can't use this method I'm just pointing out that it can't be 100% relied on (as anything client-side can't be)
|
|
|
|
|
badgrs wrote: using the browsers back and forward buttons don't cause unload events
Yes, the event is fired.
badgrs wrote: if the user has disconnected from tinternet, if the browser crashes, if you force quit the browser
Well of course you can't call a server-side method in this case
badgrs wrote: certainly IE has different ideas about when to call load events than Firefox.
As with many other things. Properly coding the application to handle different browsers is necessary in any professional, robust web application.
only two letters away from being an asset
|
|
|
|
|
Since your so adamant about it I had a little play around and I'm going to have to eat my words and say I'm wrong
I guess I didn't really give it much thought in the first place, just wanted to point out to the OP that javascript can't be relied upon....it seems we both know all about that though so no point in arguing technicalities.
|
|
|
|
|
Let's say I've got a nice webpage layed out with some snazzy designer, but somewhere in the webpage I want some dynamic content fed by, say, XML, which will consist of some controls--buttons, grids, checkboxes, textboxes, whatever.
Sooo...what's the best practice for taking a webpage and "injecting" this content before it's served to the browser? How would the web server locate the area in which to add this content? Custom tags? A div section with a name that the web server looks for?
Is this something these newfangled technologies coming out of Microsoft can do?
Marc
|
|
|
|
|
I would go for a Div or a PlaceHolder control. I had used the PlaceHolder control in one of the project, the datagrid could not provide some functionality I needed and I had to write my own html table and fill it with controls dynamically, provide support for paging. I had no idea about AJAX at that time, or else I would have used some of the AJAX controls to avoid postback issues in few cases.
|
|
|
|
|
Marc Clifton wrote: Sooo...what's the best practice for taking a webpage and "injecting" this content before it's served to the browser? How would the web server locate the area in which to add this content? Custom tags? A div section with a name that the web server looks for?
I think the asp panel container will do this for you. In the page_load event of the page you can parse your XML custom content and add all the controls etc to the panel by name.
|
|
|
|
|
Personally, I'd look at a Custom Web Control with a configurable data source that can be an Xml file or something else, having the required elements defined in the documentation of course.
Configure the data source type and path via the config file and Bobs your uncle, something entirely re-usable - just a drag 'n drop control with configuration requirements.
Some basic examples, (not my work, just quickly sampled links Googled from my home machine)...
C# Help Article[^]
Code Project Article[^]
Rhys
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it"
They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance."
Terry Pratchett
|
|
|
|
|
Hi
I am developing an application in asp.net.I used Media Player Embed Object.
It get buffer when user click on 'Play' Button.But I want to pre-buffer it.
In short I want Auto-Buffer that Media Player.
Please let me know if any body know the solution.
Swapnil Bhavsar
|
|
|
|
|
i am doing an application in which i want to split the cells of a columns in a row...
As it is difficult to show a pic here i can draw a pic for u to understand..
NAME ADDRESS City
State
Pin
i want the gridview to be viewed like this in runtime....
the name being under the name column and the city, state, and pin code being under a single column but as three cells horizonatally divided...
anyone please help me....
thanks in advance.....
SAJAN A PILLAI
C#.NET Programmer
TELESOFT INDIA PVT LTD...
BANGALORE
|
|
|
|