|
i will try it, it may solve my problem , but can anyone plz discuss this code and explain it to me
MiNa
|
|
|
|
|
When the postdatatoserver function, it programmatically submits the form to the server by calling submit on the DHTML object specified in the __EVENTTARGET element. you can also check this out this way. Put a textbox in your form, set AutoPostback to true, and have an event handler for the textchanged event of textbox. When the page is rendered in the browser, do a ViewSource, in the source you will find a code similar to
function __doPostBack(eventTarget, eventArgument) {
var theform = document._ctl0;
theform.__EVENTTARGET.value = eventTarget;
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
|
|
|
|
|
i tried this solution in a simple test application ,but i didnt work
i created a button and set the visible property of it to false and its name was Button1
then i add an image and link the onclick event of it to this function, but when i click on the image there is an error occured : error :'__EVENTTARGET" is null or not an object
all what i modify is the btnA to button1
MiNa
|
|
|
|
|
that is because the __EVENTTARGET is a html hidden field. it is not present in your page ~ add it to your .aspx file ~ but be sure that there are not more than 1 __EVENTTARGET fields in your form ~ if there are more than 1, it will not work ~ when autopostback properties of controls like textbox, datagrid, datalist etc are set to true, the __EVENTTARGET is generated automatically and in that case u will have to remove the __EVENTTARGET field that you had added in the .aspx page.
|
|
|
|
|
thanks man
i add an iage to my form
and here is what is generated in the html code page :
then i add the function between the script tag after the form tag :
function submitdatatoserver()
{
var theform;
if(window.navigator.appName.toLowerCase().indexOf("microsoft") > -1)
{
theform = document.forms["form1"];
}
else
{
theform = document.form1;
}
theform.__EVENTTARGET.value = 'Button1'.split("$").join(":");
theform.__EVENTARGUMENT.value = '';
theform.submit();
}
and i write all what i want to update in the button1 event, and still having the same error .
plzz help
MiNa
-- modified at 19:35 Sunday 25th December, 2005
|
|
|
|
|
Do you mean AJAX only supports ASP.NET 2.0? where do you search from, give me the link?
<< >>
|
|
|
|
|
Hi, I have an application that is reading a DB4 file. I can take the application, run it on the machine that hosts the webserver and it reads the file just fine. I have it all setup under ODBC Data Sources. However, when I try to do the same thing on the Webserver, gives me an error trying to open the file. Using the FileMon utility from Sysinternals.com, it never attempts to open the file, at least the file I was hoping for.
So my question is how do you tell the Webserver where the file is located?
Thank you,
Glenn
|
|
|
|
|
You haven't provided enough information to answer your question.
Where and how are the file path specified. If it is in the ODBC data source on the server then you probably need to find the path on the server where the file is located and update the ODBC setting.
If it is a relative path specified by the application, using Server.MapPath("/") will give you the directory on the server at the root of your web application.
|
|
|
|
|
I selected Data Sources from the Administrative tools. I added a User DSN and a System DSN and tried adding a File DSN. However the File DSN is not showing up but if I try to add it again it tells me it already exsists.
These are DB4 databases (.DBF and .MDX) files. The files exist in the application root directory.
I have the Webserver default page set to d:\development and I have changed WWWROOT$ to also point to d:\development. I then added a Virtual Directory called MCP which exsists under D:\development. So the directory structure is d:\development\mcp. The DB4 databases are in d:\development\mcp, which is also the path information that I put into the Data Sources.
I created a simple program that is a form that has two buttons, one says "Load Merchant" and the other says "Load Userids". The code for the userids is the same for the merchants, however the table name changes. See code below:
string strCompanyName;<br />
OdbcDataAdapter odbcDataAdapter;<br />
OdbcCommandBuilder odbcCommandBuilder;;<br />
OdbcConnection odbcConnect;<br />
<br />
DataSet dataSet = new DataSet( );<br />
<br />
odbcConnect = new OdbcConnection("DSN=MCP;");<br />
<br />
try<br />
{<br />
odbcConnect.Open( );<br />
}<br />
<br />
catch<br />
{<br />
cbMerchant.Items.Add("ERROR OPENING MCP");<br />
return;<br />
}<br />
<br />
odbcDataAdapter = new OdbcDataAdapter("Select * from Merchant", odbcConnect);<br />
odbcCommandBuilder = new OdbcCommandBuilder(odbcDataAdapter);<br />
odbcDataAdapter.Fill(dataSet, "Merchant"); <br />
<br />
DataTable dataTable = dataSet.Tables[0];<br />
<br />
foreach (DataRow dataRow in dataTable.Rows)<br />
{<br />
strCompanyName = (string) dataRow["NAME"];<br />
cbMerchant.Items.Add(strCompanyName);<br />
}<br />
When I make a non-web version of the same code it works perfect, all the entries from the DB4 file gets loaded into a Combobox, yet when I run this on the Webserver, the "catch" block of code grabs it and says, "Error opening MCP".
Filemon shows no attempt at all trying to open the database on the D drive, however I had it scoped only to D, it maybe trying to open something on C:.
I don't want to hard code a file path as this can change per installation. I know I can code something in Web.config but I rather not. I was trying to use "Code Base SQL 2.0" to read the file since I had a license for it, however it was having problems reading the Merchant Table for some reason.
Glenn
|
|
|
|
|
You are catching the exception but not the exception information, so you have no clue what the error is.
Remove the try...catch while testing, or catch the exception information and re-throw it:
try {
...
} catch (Exception e) {
throw e;
}
---
b { font-weight: normal; }
|
|
|
|
|
When I throw the exception back, this is what I get:
<br />
ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed <br />
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. <br />
<br />
Exception Details: Microsoft.Data.Odbc.OdbcException: ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed<br />
<br />
Source Error: <br />
<br />
<br />
Line 136: odbcDataAdapter = new OdbcDataAdapter(strSelect, odbcConnection);<br />
Line 137: odbcCommandBuilder = new OdbcCommandBuilder(odbcDataAdapter);<br />
Line 138: odbcDataAdapter.Fill(dataSet, "User");<br />
Line 139: #endregion<br />
Line 140:<br />
<br />
<br />
Source File: \\msp-webserver\wwwroot$\mcp\default.aspx.cs Line: 138 <br />
<br />
Stack Trace: <br />
<br />
<br />
[OdbcException: ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed]<br />
Microsoft.Data.Odbc.OdbcConnection.Open() +646<br />
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +44<br />
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304<br />
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77<br />
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +36<br />
MCP.WebForm1.pbOK_Click(Object sender, EventArgs e) in \\msp-webserver\wwwroot$\mcp\default.aspx.cs:138<br />
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108<br />
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57<br />
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18<br />
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33<br />
System.Web.UI.Page.ProcessRequestMain() +1292<br />
<br />
From what I have found on the internet, this means the driver can not connect to all types of files, but works fine without when you remove the Webserver from the picture. Not sure what makes the Webserver so special.
Any help is appreciated....
Glenn
|
|
|
|
|
I have run into this problem.
http://www.experts-exchange.com/Web/Browser_Issues/Q_21370470.html[^]
Anyone know how to fix it?
I have run MS AntiSpyware, toolbarcop and hijackthis. In toolbarcop I deleted two empty toolbar entries to no avail. All other entries look OK.
Unfortunately I don't want to subscribe to experts exchange, who look like they may have the answer.
This all happened when a colleague sent me a link to his family web site.
Kevin
|
|
|
|
|
the accepted answer
Well you wouldn't believe it! My computer has completely died and I've had to wipe the hard drive, reformat and reinstall the OS. In going through one at a time and reinstalling all my old programs over the weekend, I got to one of my favorites -- Google Desktop Search. When I reinstalled that, suddenly all my browser windows showed the DREADED white squares!! I immediately uninstalled it and everything was right back to normal!
I wrote to Google tech support, and today I received the following (the asterisks are mine):
****************
Thank you for taking the time to report this problem. We are **aware of this bug**, and our Desktop Search engineering team is working to find a solution.
We apologize for any inconvenience and hope to resolve this issue in the near future.
Regards,
The Google Team
****************
-- modified at 0:04 Friday 23rd December, 2005
|
|
|
|
|
|
Hi.
I have some problems with an ActiveX control that I have to integrate in a web page. Some methods of the control have to be called in response to events from the same control. When the page loads for the first time it works fine, but after selecting "Refresh" button of the browser (Internet Explorer) I don't receive events from the control any more, although I'm positive the object is recreated and they are being fired because I've displayed some messages in a log file from the control's code.
Any ideas?
Thanks,
Marius
|
|
|
|
|
Hi..
I want to put a page in asp ( or if not possible I could also use dot.net) to my server that will report about instant number of
> open database connection object number
> open recordset object number
> connected user number (not by counting from global.asa)
> ram and cpu used by iis...
and any usefull data like above..
where to start
karanba
|
|
|
|
|
karanba wrote: > open database connection object number
> open recordset object number
If you are using MSSQL, check out the contents of the master..sysprocesses table.
karanba wrote: > connected user number (not by counting from global.asa)
That depends on what you mean... Users are not really connected to the server other than when they are requesting a page.
---
b { font-weight: normal; }
|
|
|
|
|
Using asp.net you can get most of this information using the System.Diagnostics.PerformanceCounter class. The only potential hang up is that your page needs to have permission to read these values.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
How to send SMS through internet?
aasstt
|
|
|
|
|
IMO, You have to find an SMS provider who supplies functions (I mean APIs maybe via webservices) the what you need to do is that writting a client to access those services
Hope you get the point
<< >>
|
|
|
|
|
Dear all.
I m using dll file in my webpage using ASP.now I want my dll to generate a html file and store it into client machine using this web page.My problem is that generated file is currently saved at server.I want it must store this html file on everyone's machine who is using this webpage.Hope so you will understand my problem.I have devloped my dll file in vb.net.
help me all the way.
Urgently required!!
Uttam kumar
trickyuk001@rediffmail.com
try to be the best... whereever you go,
|
|
|
|
|
Then you have to make an ActiveX component and run it in the browser, so that it is executed on the client side. This of course requires the user to accept that the component is executed.
---
b { font-weight: normal; }
|
|
|
|
|
How can i play audio file in browser ? Does exist some HTML tags for it ? Or maybe possible to call pre-installed adio player ? Desirable with controls : Play Pause Stop FastForward Rewind
How can i implement it ?
Thank you in advance
|
|
|
|
|
Hi there,
You can use the Object[^] tag to host the player in the web page to play the audio file. You can access the methods/properties of the ActiveX player to control the funtions like Play/Stop/Pause ... using the client side script. Also you can specify the URL to download the player in the codebase attribute incase the player has not installed on the client machine. You can find some examples by using the Search functionality on the site or Googling for it.
|
|
|
|
|
Hi,
I need some help with the file upload.In my page i have one input file and when I click on a button another file upload browse should come up. the maximum upload I can do is 3.
Can any one tell how to do it???
Thanks in advance
|
|
|
|