|
Hi All,
i am using the Localization in my appliation.
my problem with the date format.here i am using different language.
my current application is working fine for default date format that is (MM/dd/yyyy). when i change to different language, then the date format is changes, then the problem with the validation control.
I am using server side validation control which support the date format (MM/dd/yyyy)only, if the date format is (yyyy/dd/mm)or (dd/MM/yyyy)then the validation does not work. How can i validate the date for different language.i,e different format.
Please help me.
Murali
|
|
|
|
|
Hello friends,
Can anybody tell me how to check manually whether the Email-id entered in textbox is valid or not, without using Regular Expression validator control.
Thanks,
Nagendra
|
|
|
|
|
You can use regular expressions in javascript, which is what the validator does, you can do some nasty string mashing because you refused to use the right tool for the job, that's about it really.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
Hello,
Thanks, i got the solution from this site only.
Thanks to u too Chris.
|
|
|
|
|
currently i m using asp.net with c# (.net 2005, 2.0 framework)
i would like to generate reports in CRYSTAL REPORTS.
i searched in google.. i cant find the exact place for me (i m a beginner to crystal reports)
where can i download E-Book for Crystal reports for .net 2005, so that i can learn from basics to expect level?
kindly guide me - KARAN
|
|
|
|
|
can i write dir="rtl" in javascript in
window.open('','','letf=0,top=0,width=280,height=180,toolbar=0,scrollbars=0,status=0')
|
|
|
|
|
Sure, if you like. It will help if you spell 'left' correctly.
What do you expect this to do ?
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
i wrote window.open ,i want when my window is open all of content be right to left means dir be "rtl"
|
|
|
|
|
I don't know, but I am guessing if you'd tried it, you'd have found your answer by now.
A quick google leaves me thinking this is generally good CSS, but not in javascript for window.open
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
I've checked many times for the incorrect syntax. But couldn't find any. There's no given location for the specific error. Here is the error and Stack Trace given when I run the appliication.
<pre>
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.
Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'Order'.
Stack Trace:
[SqlException (0x80131904): Incorrect syntax near the keyword 'Order'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +925466
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +800118
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1932
System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +31
System.Data.SqlClient.SqlDataReader.get_MetaData() +62
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1005
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +122
System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +7
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +141
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1770
System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +92
System.Web.UI.WebControls.ListControl.PerformSelect() +31
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +26
System.Web.UI.Control.PreRenderRecursiveInternal() +86
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041
</pre>
|
|
|
|
|
miss nadia wrote: There's no given location for the specific error
It would be in the query you given in SQLDataSource .
|
|
|
|
|
miss nadia wrote: How can I know the location
Walking through the StackTrace, doesn't it indicate the affected classes from your application?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Vasudevan Deepak Kumar wrote: Walking through the StackTrace, doesn't it indicate the affected classes from your application?
I doubt, since OP uses nasty SQLDataSource for binding.
|
|
|
|
|
True. And for a beginner, it would be a significantly scary.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
What does it means by OP? does this error looks complex? i hope it is not since i'm a beginner. i will post the codes and hope all of you will help.
|
|
|
|
|
The error is obvious. How many places do you use the keyword 'order' in your code ? Perhaps if you post your SQL we can help ?
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
I'm using Web User Control for Order.aspx file. This is SQL code for Order.ascx.
<pre>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ProjectConnectionString %>"
SelectCommand="SELECT Order.OrderNum, Order.OrderDate, Order.CustEmail, Order.Subtotal, Order.Shipping, Order.Total,
Customers.LastName, Customers.FirstName, Customers.Address, Customers.City, Customers.State, Customers.PostCode, Customers.Phone, Customers.Country
FROM Order
INNER JOIN Customers
ON Order.CustEmail=Customers.Email
WHERE Order.OrderNum=@OrderNum
ORDER BY Order.OrderNum">
<SelectParameters>
<asp:SessionParameter Name="OrderNum" SessionField="OrderNum" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:ProjectConnectionString %>"
SelectCommand="SELECT [ProductId], [Name], [Price], [Quantity], [Total], [OrderNum]
FROM [OrderItems]
WHERE ([OrderNum]=@OrderNum)
ORDER BY [ProductId]">
<SelectParameters>
<asp:ControlParameter Name="OrderNum" ControlID="FormView1"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
</pre>
|
|
|
|
|
And this is code for Order.aspx. Incorrect syntax that I can't find. That makes me really worried!
<pre>
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled Page" AutoEventWireup="False" %>
<%@ Register Src="~/Manage/Order.ascx" TagName="Order" TagPrefix="uc1" %>
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
If Not IsPostBack Then
ddlOrder.DataBind()
End If
Session("OrderNum") = ddlOrder.SelectedValue
End Sub
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
Choose an order to display:
<asp:DropDownList ID="ddlOrder" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource1" DataTextField="OrderNum"
DataValueField="OrderNum">
</asp:DropDownList>&nbsp;
<asp:LinkButton ID="LinkButton1" runat="server"
PostBackUrl="~/Manage/PrintOrder.aspx">Print this page</asp:LinkButton>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ProjectConnectionString %>"
SelectCommand="SELECT OrderNum FROM Order ORDER BY OrderNum">
</asp:SqlDataSource><br /><br />
<uc1:Order ID="Order1" runat="server" />
</asp:Content>
</pre>
|
|
|
|
|
I guess I would add a space after the word Order.
I guess that you concatenate strings like
String query = String.Empty;
query += "Select * FROM Order";
query += "Where Value = 1";
if you would check the content of the string query it would read:
Select * FROM OrderWhere Value = 1
Maybe this makes your problem clear.
|
|
|
|
|
how to generate excel that have validation list .
|
|
|
|
|
You ought to be little more descriptive to aide others in help and troubleshoot with your problem on hand with an elegant expedited solution.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Hi
Thanks for replying.
I want the Excel to have a drop-down list.
I have a string of xml like this:
xml.txt
<br />
<?xml version="1.0"?><br />
<?mso-application progid="Excel.Sheet"?><br />
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"<br />
xmlns: o ="urn:schemas-microsoft-com:office:office"<br />
xmlns: x ="urn:schemas-microsoft-com:office:excel"<br />
xmlns:ss ="urn:schemas-microsoft-com:office:spreadsheet"<br />
xmlns:html ="http://www.w3.org/TR/REC-html40"><br />
<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"><br />
<Author>Mee</Author><br />
<LastAuthor>Mee</LastAuthor><br />
<Created>2008-05-07T06:18:28Z</Created><br />
<Company>Ram</Company><br />
<Version>11.5606</Version><br />
</DocumentProperties><br />
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"><br />
<WindowHeight>8700</WindowHeight><br />
<WindowWidth>12315</WindowWidth><br />
<WindowTopX>0</WindowTopX><br />
<WindowTopY>120</WindowTopY><br />
<ProtectStructure>False</ProtectStructure><br />
<ProtectWindows>False</ProtectWindows><br />
</ExcelWorkbook><br />
<Styles><br />
<Style ss:ID="Default" ss:Name="Normal"><br />
<Alignment ss:Vertical="Bottom"/><br />
<Borders/><br />
<Font x:CharSet="222"/><br />
<Interior/><br />
<NumberFormat/><br />
<Protection/><br />
</Style><br />
</Styles><br />
<Names><br />
<NamedRange ss:Name="x" ss:RefersTo="=Sheet2!R1C1:R2C1"/><br />
</Names><br />
<Worksheet ss:Name="Sheet1"><br />
<Table ss:ExpandedColumnCount="1" ss:ExpandedRowCount="1" x:FullColumns="1"<br />
x:FullRows="1"><br />
<Row><br />
<Cell><Data ss:Type="String">data</Data></Cell><br />
</Row><br />
</Table><br />
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"><br />
<Selected/><br />
<Panes><br />
<Pane><br />
<Number>3</Number><br />
<ActiveRow>2</ActiveRow><br />
</Pane><br />
</Panes><br />
<ProtectObjects>False</ProtectObjects><br />
<ProtectScenarios>False</ProtectScenarios><br />
</WorksheetOptions><br />
<DataValidation xmlns="urn:schemas-microsoft-com:office:excel"><br />
<Range>R2C1</Range><br />
<Type>List</Type><br />
<Value>x</Value><br />
</DataValidation><br />
</Worksheet><br />
<Worksheet ss:Name="Sheet2"><br />
<Table ss:ExpandedColumnCount="1" ss:ExpandedRowCount="2" x:FullColumns="1"<br />
x:FullRows="1"><br />
<Row><br />
<Cell><Data ss:Type="Number">1</Data><NamedCell ss:Name="x"/></Cell><br />
</Row><br />
<Row><br />
<Cell><Data ss:Type="Number">2</Data><NamedCell ss:Name="x"/></Cell><br />
</Row><br />
</Table><br />
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"><br />
<Panes><br />
<Pane><br />
<Number>3</Number><br />
<RangeSelection>R1C1:R2C1</RangeSelection><br />
</Pane><br />
</Panes><br />
<ProtectObjects>False</ProtectObjects><br />
<ProtectScenarios>False</ProtectScenarios><br />
</WorksheetOptions><br />
</Worksheet><br />
</Workbook>
I want to convert this string to excel(*.xls) .
I try this :
<br />
f = New FileInfo("c:\test.xls")<br />
f.Delete()<br />
s = f.CreateText<br />
<br />
s.WriteLine('string from xml.txt')<br />
s.Close()<br />
<br />
<br />
<br />
<br />
This code can generate the excel file but when i import excel's data
by this code:
<br />
Dim ds As New DataSet<br />
Dim Olecn As OleDb.OleDbConnection<br />
Dim da As OleDb.OleDbDataAdapter<br />
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _<br />
"Data Source=" & FilePath & ";" & _<br />
"Extended Properties=""Excel 8.0;HDR=Yes"""<br />
Olecn = New OleDb.OleDbConnection(strConn)<br />
Olecn.Open()<br />
da = New OleDb.OleDbDataAdapter("SELECT * FROM [" + SheetName + "$]" ), strConn)<br />
Try<br />
da.Fill(ds)<br />
Catch<br />
<br />
Finally<br />
Olecn.Close()<br />
End Try<br />
Return ds<br />
This not works.
I can't import data that create from this excel.
I don't know why .
Thanks in advance
|
|
|
|
|
from page 1.aspx, when the user clicks a link, page 2.aspx appears (a popup window).
this popup (page 2.aspx) has no addressbar or toolbar.
i am getting users emial address and few more detail from this page(page 2.aspx).
i have this code in page 2.aspx code behind.
<br />
If Not Page.IsPostBack Then<br />
' Save the referrer Url<br />
ViewState("ReferrerUrl") = Request.UrlReferrer.ToString()<br />
End If<br />
what happens is, whenever i try this link from IE i am getting this errro:
Object reference not set to an instance of an object.
Line 18: If Not Page.IsPostBack Then
Line 19: ' Save the referrer Url
Line 20: ViewState("ReferrerUrl") = Request.UrlReferrer.ToString()
Line 21: End If
it shows that line 20 has error.
but this same codes works fine with Firefox.
why IE is giving me the erorr?
|
|
|
|
|
Meax wrote: Object reference not set to an instance of an object.
It means your Request.UrlReferrer is null . Since it's a popup, IE don't get the referrer. I am not sure why this works with firefox and not with IE. HTTP referrer is unreliable and many firewalls can strip that out. Alternatively check you are getting referrer using JS. Or use window.opener.location which gives opener window's location (referrer).
|
|
|
|
|
Hello,
I know that Focus is a client-side event but is there a way to call a server-side event in my code-behind file in reponse to focus change in a DropDownList? Something like,
1. Handle the focus in the javascript in the .aspx file
2. call a server-side method inside that javascript event handler?
Is that possible at all? If yes a code sample would help, becasue whatever I tried did not seem to work.
THanks for reading!
|
|
|
|