|
Hi Paddy,
Your right you know!, was the same error as below, not checking for IsPostBack, OPPS!
Regards,
Gareth.
|
|
|
|
|
Hi,
Im trying to get the value selected from a RadioButtonList. When ever i try to print out the SelectedValue.Item is null, as well as SelectIndex is -1. Even though i have selected an item. The below code gets the data from a database and binds it to the control.
SqlCommand command = Globals.StoredProcedures.SelectAll("Item");<br />
DataTable data = Globals.DbConnection.SelectData(command);<br />
<br />
RadioButtonListProductId.DataSource = data;<br />
RadioButtonListProductId.DataTextField = "ItemName";<br />
RadioButtonListProductId.DataValueField = "ItemId";<br />
RadioButtonListProductId.DataBind();
Even when i listen for the SelectedIndex_Changed event, nothing happens, like its not being fired. Any ideas?
Regards,
Gareth.
|
|
|
|
|
When you post the page back to check for the selected value, are you re-binding the data before you check it again?
|
|
|
|
|
Hi Paddy,
Yes i am, which is very silly of me! I knew it would be something silly that would be fixed in 2 seconds.
Regards,
Gareth.
|
|
|
|
|
Hi.I want to show the javascript alert message if the conditions fail,but the following code is not showing the alert message.when i am putting break point it is going to this code but not showing message.what is wrong in this code.
Page page = HttpContext.Current.Handler as Page;
if ((System.IO.Path.GetExtension(cmdBrowse.FileName).ToLower() != ".jpg") |
(System.IO.Path.GetExtension(cmdBrowse.FileName).ToLower() != ".bmp") |
(System.IO.Path.GetExtension(cmdBrowse.FileName).ToLower() != ".png"))
{
if (page != null)
{
page.ClientScript.RegisterStartupScript(page.GetType(), "msgbox", "alert('Upload only jpeg or bmp or png Images');", true);
}
}
|
|
|
|
|
I see nothing wrong with the code.
Does the response result in a page so that the script has somewhere to go? Does the page have a server form? Do you run the code before the page is rendered?
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
i have two pages on two different hosts. i am trying to write something so that if someone clicks a link on my HTML only page the content of my ASP.NET (that would be an mp3 player) page will open in a non-resizable popup (not on a new tab). i am beginner so i don't even know if i will have to write something special on my HTML page or some modifications on my asp.net will suffice. i have some VB experience so i can write ASP.NET code much more easily but i have a very little knowledge about HTML. By the way by saying HTML ONLY i mean no JavaScripts! HTML ONLY indeed.
thanks in advance.
|
|
|
|
|
Use an anchor tag to specify a link in your page that opens in a new browser window, e.g.
<a href="http://www.mysite.com/"
target="_blank">Visit my site</a>
However, if you wanted to make the window non-resizable, you would need to use Javascript.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
i used flash instead of asp.net to make an mp3 player. there is a special tag on the host to add swf files to the site. now i don't need a new window. i needed one before, because the host didn't allow tag too. so i think this is the only way to include my mp3 player on that site. thanks for the answer anyway.
|
|
|
|
|
Hi, every one
I have a text box where i need to fill a name so i have given a regular expression validator for the text box so that user can fill only alphabets. The expression which i gave is [A-Z]*|[a-z]*.
when im giving all small letter it is working but if i give a capital letter follwed by small letters it is not working.
pls help me
|
|
|
|
|
sivaram praveen wrote: I have a text box where i need to fill a name so i have given a regular expression validator for the text box so that user can fill only alphabets. The expression which i gave is [A-Z]*|[a-z]*.
when im giving all small letter it is working but if i give a capital letter follwed by small letters it is not working.
The correct syntax is [A-Za-z]* to capture zero or more upper/lower case alpha characters.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Thanx 4 ur reply, it worked
|
|
|
|
|
Hi
I have a class which implements the singleton design pattern and is responsible for data access. The class primarily read database settings and establis a connection to a database. This class works more than 100% in my win-forms applications.
I am now starting an ASP.Net application and am wondering whether I can use the same class for my data access.
Yes it will work, but is it advisable? Will there be some problem or performance issues if I have 50 users connecting to my site?
Thank you.
Jacques Naudé
jnaude@gmail.com
|
|
|
|
|
This[^] might help you to use it in ASP.NET
|
|
|
|
|
You might be able to change it to make it work, but it's not advisable. Here are some reasons:
- A web application is a multi threaded application, so you need to make a singleton that is unique for the thread, not for the application. You can't share the same connection between threads.
- Putting the connection in a singleton makes it more complicated to close the connection properly. You don't want to keep the connection open between requests.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Guffa wrote: You might be able to change it to make it work, but it's not advisable
It depends how it is designed to work in the first place. If each method in the singleton creates its own connection and closes it by the end of the method then there aren't any problems. I typically store only the connection string so I can have as many connections running as I want.
|
|
|
|
|
Colin Angus Mackay wrote: If each method in the singleton creates its own connection and closes it by the end of the method then there aren't any problems.
In that case the singleton is pointless, and you can just make the methods static.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Guffa wrote: In that case the singleton is pointless, and you can just make the methods static.
True.
|
|
|
|
|
jnaude wrote: This class works more than 100% in my win-forms applications.
That's an interesting performance metric. Got some figures to back it up?
|
|
|
|
|
Hi!
In a website we generate a drilldown report from a GridView component. With Javascript the onclick functionality is added and works fine.
We generate a DataTable depending on rownumber and columnnumber from the click.
As soon as we have the data in the DataTable we export the DataTable to Excel. Works fine.
If i Close Excel and want to click on a button in the webpage (Run Report-button) I get again the same Excel as I just Closed.
Somehow my webpage is out of sync.
How do I get in InSync again?
Method to send the DataTable to an aspx file for exporting to Excel:
private void DrillDown(DataTable drillDown)
{
try
{
Page.Session.Add("excelTable", drillDown);
Page.Session.Add("excelName", "DrillDownClaimsReport");
Page.Session.Add("returnPageAfterExport", "../Reports/ClaimReport.aspx");
Response.Redirect("../Export/DataTableToExcel.aspx");
}
catch (Exception err)
{
lblError.Text = err.Message;
}
}
Page DataTableToExcel.aspx.cs:
using System;
using System.IO;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Export_DataTableToExcel : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
DataTable excelTable = new DataTable();
String excelName = String.Empty;
String returnPage = String.Empty;
excelTable = (DataTable)Page.Session["excelTable"];
excelName = (string)Page.Session["excelName"];
returnPage = (string)Page.Session["returnPageAfterExport"];
ExportDataTableToExcel(excelTable, excelName, returnPage);
}
private void ExportDataTableToExcel(DataTable table, String fileName, String returnPage)
{
Response.Clear();
Response.AddHeader("content-disposition", String.Format("attachment;filename={0}.xls", fileName));
Response.ContentType = "application/ms-excel";
Response.Charset = "iso-8859-1";
String Combineer = String.Empty;
String sep = String.Empty;
foreach (DataColumn dc in table.Columns)
{
Combineer += sep + dc.ColumnName.Replace("_", " ").Replace("occurrence date", "Date of Loss");
sep = "\t";
}
Combineer += "\n";
int i;
foreach (DataRow dr in table.Rows)
{
sep = String.Empty;
for (i = 0; i < table.Columns.Count; i++)
{
Combineer += sep + dr[i].ToString();
sep = "\t";
}
Combineer += "\n";
}
Response.Write(Combineer);
Response.End();
Page.Session.Remove("excelTable");
Page.Session.Remove("excelName");
Page.Session.Remove("returnPageAfterExport");
Response.Redirect(returnPage);
}
}
Help Needed!!!
|
|
|
|
|
im working in asp .net for 2 years and i wanna go to the next step.
so plz i wanna to know?
1-what DLLs should i install (i need link).
2-and simple example will be nice
regards
|
|
|
|
|
1 - None. AJAX is just a mishmash of things you had all along. If you want to use the ASP.NET AJAX library, that's a whole other thing. For that you need to install the library
2 - I'd recommend the book 'AJAX in Action' and if you want to use the ASP.NET library, the ASP.NET AJAX in Action is the best book going on that front.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Ahmad Adnan wrote: what DLLs should i install (i need link).
As Christian graus said[^], you have misunderstood that AJAX is created by Microsoft. It's not. They created a library that supports AJAX and make things easy. AJAX is just javascript. You need to look here[^] to start.
To use AJAX library created my MS, download it and install AJAX extensions. Use the AJAX toolkit.dll with your project.
Hope it helps
|
|
|
|
|
Hi all,
I'm working on a project that uses the eBay SDK and first I need to test a few things by making a Store in the Sandbox. I'm working on it for the first time and I know we can't make a store in the Production thru API but this article in their documentation tells something taht we can make a store in the sand box for testing purposes.
Managing eBay Stores
I've been looking around for quite a while now but I'vent been able to find some thing that tells me how I can create a store like that.
if any one of u has worked on such a project plz give me some guideline. that would be much help!
Thanks in advance
-- modified at 4:29 Thursday 8th November, 2007
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
Your post scrolls, can you make the link to some text and link to it?
|
|
|
|