|
Sorry, I was home when you posted all of this ( different time zone ). I'm glad you worked it out, and I have to say, your code took a quantum leap, which is great.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
ok i have changed it back to a repeater, and i cannot get it to update now.
is this the same problem or similar that is listed here [ http://support.microsoft.com/?kbid=197428 ] or is there another problem i am missing in my code?
< asp : Repeater id="cartItems" runat="server" DataSource="<%# orderSummaryDataSet %>" DataMember="OrderSummary1" >
< HeaderTemplate >
<table width=85% cellpadding="3" cellspacing="3">
<tr class="artistType" vAlign="middle" align="center">
<th> </th>
<th>Product Code</th>
<th>Quantity</th>
<th>Item Cost</th>
<th>Item Total</th>
<th>Cart Total</th>
</tr>
<tr class="artistType" vAlign="middle" align="center">
<th colspan="5">
</th>
<th style="color:red;">
<%# CartTotal %>
</th>
</tr>
</ HeaderTemplate >
< FooterTemplate >
</table>
< /FooterTemplate >
< ItemTemplate >
<tr class="artistType" vAlign="middle" align="center">
<td>
<input type="hidden" name="code" id="code" runat="server" value='<%# DataBinder.Eval(Container.DataItem, "OrderSummaryProductCode") %>' / >
<img src='<%# DataBinder.Eval(Container.DataItem,"OrderSummaryImageUrl") %>' height="<%# THUMB_HEIGHT %>" width="<%# THUMB_WIDTH %>" />
</td>
<td><%# DataBinder.Eval(Container.DataItem, "OrderSummaryProductCode") %></td>
<td>
< asp:TextBox AutoPostBack="false" id="txtQty" style="width:25px;" Text='<%# DataBinder.Eval(Container.DataItem, "OrderSummaryProductQuantity") %>' runat="server" MaxLength="2" / ></td>
<td>$<%# DataBinder.Eval(Container.DataItem, "OrderSummaryProductCost") %></td>
<td>$<%# DataBinder.Eval(Container.DataItem, "OrderSummaryProductTotal") %></td>
<td></td>
</tr>
< /ItemTemplate >
< /asp:Repeater >
and this is the btnUpdate click event for a single button that should update my dataset
private void btnUpdateCart_Click(object sender, System.EventArgs e)
{
foreach(RepeaterItem item in cartItems.Items)
{
TextBox qtyCtrl = (TextBox)item.FindControl("txtQty");
HtmlInputHidden codeCtrl = (HtmlInputHidden)item.FindControl("code");
try
{
int qty = Int32.Parse(qtyCtrl.Text);
string code = codeCtrl.Value;
BasicCart cart = (BasicCart)Session["cart"];
cart.SetQuantity(code, qty);
} catch { /* TODO : fix this */ }
}
}
when i step i through the code, qty is the value before i change it in the form.
any ideas please ?, sorry about formatting, couldnt get it to preformat with tags
kind regards,
g00fy
|
|
|
|
|
I believe you will have to bind the updated datasource again to get the updates reflected since the data are being set by binding it to the control.
|
|
|
|
|
Is there a way to display the DPI (bitdepth) property of an image file such that it can be captured or displayed?
Okay, now the background of this:
I'm working on scanning family historical photos at home and, as part of the photo information, I want to capture what DPI I scanned the photos at. Some are 300 DPI, some 600 DPI, etc. I don't want to have to check the property page for each image (there are now ~600 images in the collection). I'd like to generate a way to do this via javascript/vbscript if possible, so that I can gather other information while writing the information to the database. I'd also like to keep the number of dependant programs to a minimum.
Thanks,
-m
|
|
|
|
|
hi all
i created a list using javascript rollover, and i want the user when click on one item in this list to call an ASP.NET event which will update a datagrid,i am using asp.net verison 1.1 .
Thanks.
MiNa
|
|
|
|
|
Hi there,
IMO, you might have a look at AJAX.
<< >>
|
|
|
|
|
when i search fro it i found that it is supported to asp.net vertsion 2.0, i need something work fpr version 1.1
Thanks
MiNa
|
|
|
|
|
i believe you want to invoke a post back from javascript so that you can process the datagrid updation in the code behind ~ if this is it then what you can do is have a hidden ASP Button in the aspx page ~ say 'btnA' ~ call the js function below ~ this will cause a post back for btnA click event ~ in the btnA's click handler you can write the datagrid updation code
function submitdatatoserver()
{
var theform;
if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
theform = document.forms["form1"];
}
else
{
theform = document.form1;
}
theform.__EVENTTARGET.value = 'btnA'.split("$").join(":");
theform.__EVENTARGUMENT.value = '';
theform.submit();
}
-- modified at 7:14 Thursday 22nd December, 2005
|
|
|
|
|
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; }
|
|
|
|