|
Hi
here
1) if your machine setting is as per the islamic.
then
DateTime dtNow = DateTime.Now;<br />
string strdate = dtNow.ToString("g",System.Globalization.CultureInfo.InstalledUICulture);<br />
or you can specify the
2)
string strdate = dtNow.ToString("g",System.Globalization.CultureInfo.CurrentUICulture);<br />
<br />
* d :08/17/2000<br />
* D :Thursday, August 17, 2000<br />
* f :Thursday, August 17, 2000 16:32<br />
* F :Thursday, August 17, 2000 16:32:32<br />
* g :08/17/2000 16:32<br />
* G :08/17/2000 16:32:32<br />
* m :August 17<br />
* r :Thu, 17 Aug 2000 23:32:32 GMT<br />
* s :2000-08-17T16:32:32<br />
* t :16:32<br />
* T :16:32:32<br />
* u :2000-08-17 23:32:32Z<br />
* U :Thursday, August 17, 2000 23:32:32<br />
* y :August, 2000<br />
* dddd, MMMM dd yyyy :Thursday, August 17 2000<br />
* ddd, MMM d "'"yy :Thu, Aug 17 '00<br />
* dddd, MMMM dd :Thursday, August 17<br />
* M/yy :8/00<br />
* dd-MM-yy :17-08-00
regards
GV Ramana
|
|
|
|
|
How to resize a datagrid at run time using Asp.net and VB as code behind.
|
|
|
|
|
Hello
I use vs 2005. Can anyone tell me where i can find a tutorial to do something like www.orca.com main animation(the world zone selection) ??
|
|
|
|
|
I'm trying to publish an ASP.NET application with VS 2005, and after I choose the folder everything goes smoothly and the Output window tells me
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========<br />
========== Publish: 1 succeeded, 0 failed, 0 skipped ==========
But the folder it's supposed to publish to is empty.
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
IMHO, there are a couple of things that you may try:
+ Choose the File System for the Target Location if you don't.
+ Use the ASP.NET compile tool: aspnet_compiler.exe.
+ Try with a new location.
+ Try publishing with a simple application.
|
|
|
|
|
minhpc_bk wrote: Choose the File System for the Target Location if you don't.
I do.
minhpc_bk wrote: Try with a new location
I tried different locations. Same result.
minhpc_bk wrote: Try publishing with a simple application
This is just the thing. It doesn't work for this applciation. For others it's ok. Someone said on the asp.net forums to create a new project and add the files from the ex-project one by one. This has the effect on working again for him. Eventually if everything else goes wrong, I'm gonna try it, though it's a big project
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
Fixed it. I ran aspnet_compiler with the -errostack directive in the shell prompt and the output was the following error: HttpParseException: Unexpected end of file looking for </link> tag .
Aparently some of my pages were not XHTML compliant. After closing properly the tags, everythign runs smoothly and the website publishes correctly.
But what the heck did that error emerge in the first place? I have no doctype in my pages specifying that my pages should be XHTML compliant.
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
Glad you figured out the cause.
Mircea Grelus wrote: But what the heck did that error emerge in the first place? I have no doctype in my pages specifying that my pages should be XHTML compliant.
Do you have any xhmtl conformance setting in the web.config file? Also, in the VS do you choose the xhtml in the Target Schema for Validation? Do you see any error in the Error List window when you build the web site in VS?
|
|
|
|
|
minhpc_bk wrote: Do you have any xhmtl conformance setting in the web.config file?
No.
minhpc_bk wrote: Also, in the VS do you choose the xhtml in the Target Schema for Validation?
Unchecked
minhpc_bk wrote: Do you see any error in the Error List window when you build the web site in VS?
No errors.
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
I have created a dynamic control (Button) inside a click event of another button. But, I'm not able to trigger the click event of the dynamically created button! I know there is something goin on with the page cycle, dynamics,...Can anyone post me a simple, easily understandable solution to my problem?
Thanks
|
|
|
|
|
Have you created an event handler for the dynamic button to associate itself to?
Nila Fridley
|
|
|
|
|
You need to make sure two things:
+ The dynamic button is readded on postback.
+ The dynamic button is added before the postback event is processed, if it occurs too late in the page life cycle, the event does not get fired, and as a result the event handler does not execute. You can easily find the sample code out there, clickety[^]
|
|
|
|
|
|
How can I call a static method from a user control (ascx) before loading the control in the page collection?
What I need to do is receive some data from the static method of the control prior to loading it into the Page.
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
Refactor the code into its own class then call it on PreRender method of the Control you wish to load
Look where you want to go not where you don't want to crash.
Bikers Bible
|
|
|
|
|
The thing is that I need to call that method in a page that the control must not be shown.
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
If you really must, then load the control into a panel, then hide the panel. You can then call the control from there.
Look where you want to go not where you don't want to crash.
Bikers Bible
|
|
|
|
|
Mircea Grelus wrote: What I need to do is receive some data from the static method of the control prior to loading it into the Page.
I'm not sure what is your purpose behind the sense, but you may try overriding the FrameworkInitialize method to call the static method of the user control. Basically, this method is called when the page control tree is built.
|
|
|
|
|
Managed to do it through Reflection. I changed the static method into a property and then:
Control ctrl = Page.LoadControl("~/Modules/SignIn.ascx");<br />
Type type = ctrl.GetType();<br />
System.Reflection.PropertyInfo info = type.GetProperty("Rights");<br />
string[] rights = (string[])info.GetValue(ctrl, null);
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
IMO, reflection seems overkill in this case as you can cast the result of the LoadControl method to the user control type before you access its property/method. With the ASP.NET 2.0, you also need to use the Reference directive in the web page so that you use the user control type in the web page. Another option is that you can define an interface with the property and have the control implement the interface, then in the web page you can cast to the interface to use the property/method.
|
|
|
|
|
minhpc_bk wrote: you also need to use the Reference directive
Well I was trying to avoid that. Why? Because I'm using it in a page in a framework. The ideea is that after the framework is deployed other modules can be developed. So I don't really know what user controls I'm dealing with. All I need to do is receive some properties from that user control. All user controls developed for this framework inherit from a base class that property. So if it isn't defined in the control, I get the properties of the base class.
Probably this might be overkill by I see no other way of acomplishing this right now.
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
Hello everyone,
I'm looking for a way to trigger a javascript confirmation dialog box and capture its value via a function as opposed to button events (as per all the tutorials I've found). The reasoning behind this is that are are 3 separate things that could trigger this dialog - 2 being button events, and one being page load if certain circumstances are met. Needless to say I don't want to write 3 separate functions for these if I don't have to, I'd rather just call the main confirm function from pageload and/or the button event handlers as appropriate.
Does anyone have any ideas? Thanks in advance!
-------------------
abort, retry, fail?
|
|
|
|
|
You could write two functions in form of a string, one is your confirm, and the other is the function that will capture the confirm value (val1, val2, etc). Then on the server side you will have to implement ICallbackEventHandler interface, incorporate the two methods that come with it (GetCallbackResult, and RaiseCallbackEvent).
Next, register your javascript(RegisterClientScriptBlock), then tie them all up in a string that holds the value of 'GetCallbackEventReference'. Once that's done, then you will want to add the GetCallbackEventReference string to a control's "onclick" attribute, OR you can place it within yet another javascript that will get triggered at some point in time... I know, this sounds a little confusing, but maybe if you give me the specifics of your project I could try to write it for you (I just did something very similar to this yesterday and it worked!)
Nila Fridley
|
|
|
|
|
Or you could just register a little js - no need to implement anything else....seems like you're over-complicating things a little
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Rich, it all depends on exactly what he is intending on doing with the captured value... first off, he will have to write a function for the confirm, and one to capture value. Then if he needs to process the captured value on the server side, then he would most certainly need to create a 'receiver' js function, and give it an event reference, and call the referenced function from within the js that captures the value of the confirm. Without the event reference (or a complete page postback), the server won't be able to process anything.
When you think about even the smallest asynchronous functionalities, in pure english it sounds very easy, but translating it to .net is rather 'screwy'
Nila Fridley
|
|
|
|