|
Shivan Nandan wrote: How to get the date field to be displayed according to the cultural format
CultureInfo ci = new CultureInfo("de-DE");
DateTime.Now.ToString(ci.DateTimeFormat.ShortDatePattern, ci.DateTimeFormat) But this will not help you as you are using ASP.NET. This will use servers culture information.
As Christian told, you need to have some mechanism to get the users culture. Most easy way is to ask them to provide it.
|
|
|
|
|
Dear friend,
Thanks for your response.
I am not using dt.tostring() method. My code is given below
DataSet ds = new DataSet();
ds = obj.GetData();
gvList.DataSource = ds;
gvList.DataBind();
The "ds" contains records and one of the field will be a datetime type. So I want that datetime field value to be displayed according to the cultural settings. Also gvList's Autogenerate colums is true.
Shivanandan C V
|
|
|
|
|
hello everyone,
my problem is i am trying to create a contact page where there is a fieldset for primary contact and another for secondary. i added a check-box so that if the applicant's primary contact is the same as the secondary, the values in primary contact will be displayed in the textfield of the secondary and at the same time make the textfield not enabled.
i tried this in a windows form application and it worked fine, but when i tried it in the web page it did not.
can anyone help me with this and if possible explain to me why this is so cos i was thinking maybe it is the validation property.
i am open to ideas, thanks
|
|
|
|
|
I'm not sure how code you wrote in a winforms app has anything to do with it, given that this would be C# or VB code, and you need to write javascript to do this on the client, unless you want the page to reload when the user checks the check box, in which case, set autopostback to true.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
yeah, i was thinking that i would have to use javascript but i don't know anything in that area because i don't want an auto postback. i think i tried that one but it didn't work.
If you can help me with the javascript i'd much appreciate it. thanks
|
|
|
|
|
can u tell me how dow did you do that?
Cheers!!
Brij
|
|
|
|
|
I have provided a option in my project. When a user attempts to close the application with out logging out, we used to prompt for a alert too log out. The below said Javascript works well for this.
<script type="text/javascript><br mode=" hold=" /> window. önbeforeunload = confirmExit;<br mode=" you="" haven="t finished yet! Please press " cancel=" to continue."); <br mode="hold" /> return false; }<br mode="hold" /> </script><br mode="hold" /> But windows internet explorer prompts another confirmation like this<br mode="hold" /><br mode="hold" />"Are you sure you want to navigate form this page?" and shows ok and cancel button. Is there any possibility to control this option or control the number of buttons in the ie confirm box. </xml>"></script>
|
|
|
|
|
nithydurai wrote: or control the number of buttons in the ie confirm box
NO.
|
|
|
|
|
No.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Not possible
Cheers!!
Brij
|
|
|
|
|
I have for e.g saurabh@yahoo.com in Textbox
i only want characters before @ i.e saurabh.
What should be the property for textbox to do this..?
|
|
|
|
|
The Text property gives you the string. IT's a string, it has methods for finding characters. Or you can use a RegEx, if you want, but it's not needed to just find the @. I'd use the split method for that.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Sorry i dint get your ans can u describe me using some example..!!
|
|
|
|
|
Christian has already given you the key words to search for "string" and "split" - now you should probably look in your book or google for it.
|
|
|
|
|
If you're incapable of using google or exploring the methods on the string class using intellisense, perhaps the world has lost a janitor without gaining a programmer ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Textbox returns string.You can use split function.
Cheers!!
Brij
|
|
|
|
|
saurabh mohal wrote: I have for e.g saurabh@yahoo.com in Textbox
i only want characters before @ i.e saurabh.
What should be the property for textbox to do this..?
I didn't get your point. You want something MaskedTextbox (in Windows Form)
|
|
|
|
|
Well, Christian gived you answer but I will give you too example.
string email = textBoxName.Text.Substring(0,textBoxName.Text.IndexOf("@"));
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Hi from a newbie,
I am looking for a simple newsletter module, where people can subscribe to without registration (of course a DB needed to store the e-mails preferable already verified - and an admin screen).
I am writing an individual asp.net web app. (no cms, starter kit). So it would be nice just to insert a new piece of code into the existing.
I am well grounded at C# but I do not want to develop this module from scratch.
Could you recommend me a particular code/module, or a place where I could find it.
Thanks in advance.
Zoltan - Hungary
|
|
|
|
|
|
Well, the obvious way to do that, is to have a bunch of folders which all contain a default.aspx. Of course, this means you can never pass anything on the query string.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
no problem..just i want to extention remove method... give me the code
|
|
|
|
|
nithydurai wrote: give me the code
There is no code. Just do what I said. If a folder is called 'editmember' and it contains a default.aspx, then IIS will serve that page if no page name is provided.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian Graus wrote: Of course, this means you can never pass anything on the query string.
www.somewebsite.com/somedir/?querystring=somevalue is valid. The default page in this directory will be called and can access the query string.
|
|
|
|
|
can u xplain about scenario
Cheers!!
Brij
|
|
|
|