|
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?
|
|
|
|
|
ok here u go! now its ok
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
Hi frnds,
I hv a page which is in panel. If i directly click on Save Button, Validation in code behind takes place to check all values are entered or not.
If any value is not entered it displays the text in lable which is on the top of page but the focus is still on Save Button instead of moving to the top..
Plz help me out..
thnks in advance
|
|
|
|
|
Hi all,
How can i raise an synchronous post back by javacript function in asp.net ajax?
I don't want to do this by web services.
I want raise an synchronous post back by javacript function.
(Or) How can i raise an synchronous post back of UpdatePanel control by javascript function?
thanks
-- modified at 4:14 Thursday 8th November, 2007
|
|
|
|
|
It's very simple with pure Javascript (without using ASP.NET AJAX)
Pass "false" in the third parameter of open method of XmlHttpRequest object.
req.open("GET", url, false);
|
|
|
|
|
Hi Michael,
Thanks for your help, but how can i raise an synchronous post back by javascript with asp.net ajax (without web services).
|
|
|
|
|
i am developing an application where i have a gridview which dispalys search values when i click a search button. But intially when the page loads gridview should show only
the header and empty rows and columns and it should be populated with values only on clicking the search button. can u give me any solution please?
|
|
|
|
|
You can create a dummy DataTable and bind it to the GridView. It will show only the headers
|
|
|
|
|
Hi There,
I am posting a Sample hope it helps you,
if (sDataSet == null || sDataSet.Tables[0].Rows.Count == 0)
{
sDataSet.Tables[0].Rows.Add(sDataSet.Tables[0].NewRow());
GridView1.DataSource = sDataSet;
GridView1.DataBind();
int TotalColumns = GridView1.Rows[0].Cells.Count;
GridView1.Rows[0].Cells.Clear();
GridView1.Rows[0].Cells.Add(new TableCell());
GridView1.Rows[0].Cells[0].ColumnSpan = TotalColumns;
GridView1.Rows[0].Cells[0].Text = "No Record Found";
}
else
{
GridView1.DataSource = sDataSet ;
GridView1.DataBind();
}
Cheers
Menon
|
|
|
|
|
you can use EmptyDataTemplate
<EmptyDataTemplate>
<table width="100%" border="0" cellspacing="0">
<tr style="background-color: #5D7B9D; font-weight: bold; color: White; width: 100%;">
<td>
Name </td>
<td>
Surname</td>
<td>
City</td>
<td>
Phone</td>
<td>
</td>
</tr>
</table>
</EmptyDataTemplate>
|
|
|
|