|
How can we check whether a certain culture is supported by the framework or not. I have 2 strings as "en-US" and "MyName". It should set the culture if I pass "en-US" and should take the default culture of the browser if i pass "MyName". Can anyone suggest.
|
|
|
|
|
You could use the CultureInfo object in the Globalization namespace. This has a contructor that takes the "en-US". Try that and in the catch you could do a Request.UserLanguages.GetValue(0)
|
|
|
|
|
guys i would like to ask how to create buttons during run time if its possible that is.
|
|
|
|
|
Dim loButton as Button = New Button
loButton.Text = "Some Text"
loButton.Visable = True
form1.Controls.Add(loButton)
You should try looking at MSDN first. You will most likly get most of these answers from there without having to wait.
|
|
|
|
|
Well i want to add few more things in the code that TadMcClellan has provided.
Provide the type of button that you want to create that is either HTML control input button or WebControl
Dim System.Web.UI.WebControl.Button as btn=new System.Web.UI.WebControl.Button()----This is for WebControl buttons..
similarly u can provide anytype of button..
May be i m helpful to u..
KHATRI
|
|
|
|
|
hi guys i am in need of syntex for asp 1.1:
connecting to an ms sql database during runtime.
i would also like to ask if it is possible to connect to the database server at the same place.
meaning if it is possible to connect to the database server and the database in the script while in run time.
|
|
|
|
|
Um.. Yes. Actualy this is how you should do it, using some common object to open the connections and commands for you and returning the datatables you need.
If you use C# be sure to use the "Using" Syntext. In 1.1 VB.Net you can't do this so be sure to close the connection after your done with it.
If you need help with Conection Strings go Here[^].
Do an MSDN Search on SQLConnection and that will give you the syntext you need.
|
|
|
|
|
In my asp.net 2.0 app I have the following line in my web.config assemblies section:
add assembly="Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"
(I took out the angle brackets becuase the forum was causing it all to hide)
I didn't put it there, and in fact when I take it out, as soon as I start a debug run it puts it back automatically. Normally no sweat off my back, but the Windows 2003 server I'm testing on doesn't like it at all and chokes on it. I remove it from that server's web.config and it runs just fine, all features that I can tell so far.
Is it being added to support debugging through IE or...?
|
|
|
|
|
ACT Application Center Test (perhaps the most awkward product name ever)
I have a license for ACT with my vs 2003 but found it appeared to freeze while building a script by browsing on my 10 user limited xp pro IIS on my dev station with a particularly complex ajax intensive form. I'm not sure if the problem is that it's just getting too old to deal with modern stuff like ajax and .net 2.0 or it's just my 10 connection limited web server which I have run up against from time to time while debugging.
I'd love to know if anyone is still using it with modern asp.net apps and if there is a chance it will work properly with the windows 2003 test server I'm going to ultimately be load testing on.
|
|
|
|
|
Hi ,
Using PostbackURL property in ASP.NE 2 to pass the values of controls between pages
Now if we have different controls in page 1 and we link page1 to page 2 by setting the PostbackURL property of link button in page1 to be linked to page 2
And in page 2 we use Request.form[“Control Name”] to get the values of some controls of page 1
Is this impact the performance of application ( slowness ) if page 1 contain a lot of controls ?
|
|
|
|
|
No. If you are using Request.Form, you are reading the values directly from the form data sent from the browser. It doesn't involve the server controls of the first page at all.
---
b { font-weight: normal; }
|
|
|
|
|
Ok thanks
Im using master pages, when i use PostBackURL with button control to pass the values of controls in page 1 to page 2 its give me the follwing exception
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
But when I use it with normal pages that not use master pages its work with postbackurl in page 1 and request.form in page 2 to get the values of controls in page 1
why its nor working withe pages that use master pages
|
|
|
|
|
The id of controls inside containers, like in master pages, gets the id of the container prepended to it. Check the source of the html page to see what the field's names are.
---
b { font-weight: normal; }
|
|
|
|
|
Hey guys i have a small problem.... im sure you can help
I have a new project, with 2 buttons on Button1 and Button2... The code behind button1 is simple:
Textbox t = new Textbox();
t.Text = "hello world!";
form1.Controls.Add(t);
when i click Button1 - wow! it adds the control! No problem, i noticed that i can click the button as many times as i want and only 1 textbox ever appears. so Click button1, then click Button2 - POW! its vanised!
Whats the correct method of keeping a control "alive" on a page (as well as preserving any events it has?)
Cheers
Will
|
|
|
|
|
I'm not an expert by any means on this, however I believe it might have to do with the point at the page event lifecycle when you create the controls. From what I understand any dynamic controls should be created very early in the page lifecycle and I use the Page_Init event always for dynamic controls and have had no problems with them. However I did have problems when trying to create them on page_load.
|
|
|
|
|
You shouldn't have any problem with adding controls in Page_Load. The Page_Init didn't event exist in framework 1.x.
---
b { font-weight: normal; }
|
|
|
|
|
Right, although they do recommend Page_Init and some 3rd party components I'm using require that as well because if you create them any later you don't get their values properly from viewstate.
http://support.microsoft.com/kb/317515
|
|
|
|
|
Yes, for some reason that is not revealed, it says that Page_Init is the best place for it, but it also says:
"When you create dynamic controls on a Web Form, you must create the controls and add them to the controls collection in either the Page_Init event handler or the Page_Load event handler."
So, either works for dynamic controls.
If some controls need to be created in Page_Init, it's because how they are built, not because you create them dynamically.
---
b { font-weight: normal; }
|
|
|
|
|
No, I looked a little deeper into it and you *must* create them in Page_Init if you want their viewstate to be restored properly because the event that loads viewstate into the controls occurs before Page_Load but after Page_Init.
|
|
|
|
|
Are you sure? Has this changed between framework 1.1 and framework 2.0? Otherwise it would be impossible to use dynamic controls in framework 1.1, as there is no Page_Init.
---
b { font-weight: normal; }
|
|
|
|
|
Maybe it's changed, not sure, I never used .net 1.x with asp.net, but that's been my experience with asp.net 2.0 and that's what Microsoft detailed on the page I found at the time when I looked it up on MSDN.
I use dynamic controls for a custom fields section on many of my forms and if I don't create them in page init then I can't retrieve their values later on in the page lifecycle.
|
|
|
|
|
Every postback produces a completely new Page object, so to make a dynamically created control stay on the page, you have to recreate it on every postback.
---
b { font-weight: normal; }
|
|
|
|
|
Hello,
When I create a web site I usually create an .aspx and an .aspx.vb file
for each page.
However, I create all my page code in my VB code at runtime.
What I would like to know is:
Is there a development model where the Aspx pages (.aspx files) are
also created at runtime.
If yes could you tell me if should I do it?
Can you give me any advice on creating everything at runtime in my VB
or C# code?
Thanks,
Miguel
|
|
|
|
|
hi!i have a problem for following code.
when i use this code in win-2000 server then there is no prblem
System.Windows.Forms.IDataObject clipboardData = System.Windows.Forms.Clipboard.GetDataObject();
but when try to execute this code in win-server 2003, then follwing exception is throwned
ex = {"Requested Clipboard operation did not succeed."}
please give me solution.
Amit Kuamr Pandey
|
|
|
|
|
I have an image inside a DIV tag.When i click the mouse in a IE browser,at the particular position of mouse click,i need to display the DIV tag's image.
I have captured the coordinates of the mouse click.
HOw to set the X,Y coordinates to the image i have taken inside the DIV tag using javascript.
|
|
|
|