|
In code behind, borderstyle property is set. I want to do the same using javascript.
TextBox.BorderStyle = BorderStyle.NotSet;
Can you suggest something using
document.getElementById('<%=TextBox.ClientID%>'...?
Please help.
Thanks
|
|
|
|
|
This is a C# forum, you might want to ask in the Web Development forum.
"Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus
|
|
|
|
|
hi
I cant seem to add 24 hours onto a datetime variable.
i have a startTime value and with that i want to add 24 hours to it to get a endTime.
what i have right now is:
DateTime startTime = DateTime.Parse(Request.QueryString["LogonDate"]);<br />
<br />
DateTime endTime = startTime;<br />
<br />
endTime.AddHours(24);
startTime's value is for eg. "2007/06/01 12:00:00AM"
but its not adding 24hours to endTime variable. It stays the same as the startTime.
Please somebody help me..
|
|
|
|
|
try this instead:
DateTime startTime = DateTime.Parse(Request.QueryString["LogonDate"]);
DateTime endTime = startTime.AddHours(24);
Without checking the docs I strongly suspect AddHours returns a new DateTime instead of modifying the existing one.
--
If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.
|
|
|
|
|
dan neely wrote: Without checking the docs I strongly suspect AddHours returns a new DateTime instead of modifying the existing one
Correct - DateTime is immutable.
|
|
|
|
|
Hi,
the DateTime methods return a new DateTime, they do not change an existing one,
hence you need endTime=endTime.AddHours(24);
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
As others have said, the methods on DateTime do not modify the object you have. That is because the DateTime object is immutable. That means that once it is created it cannot be changed, you have to create a new one.
Had you done the simplest of research - like read the documentation - you would have found this out. (Hint: In pretty much all windows applications pressing F1 will bring up the documentation.)
|
|
|
|
|
Perhaps his F1 key is immutable and mapped to 'Switch Weapons' or 'Strafe'. (Do games still have strafe, like the original Doom?)
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
Malcolm Smart wrote: Perhaps his F1 key is immutable and mapped to 'Switch Weapons' or 'Strafe'. (Do games still have strafe, like the original Doom?)
I doubt he's up to any game beyond Snap.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
i want to develop a simulation program that can be used to simulate the actual windows
i.e :: in the MCSE exams there is a part is called simulation questions, in these questions a window like the actual windows interface appears and you can interact with it, as if you are dealing with actual windows environment
if any one have any idea how can i design this,, i need help about this topic
many thanks
Omar Elhadad
Software Developer
omer
|
|
|
|
|
Please don't repeat your posts. This is a free site - people will respond to your original question in their own time.
Paul Marfleet
|
|
|
|
|
There may be some instances that I would load the dll library. One time that I might be using this abc.dll then later in time that I would have the application to change to different dll which would be xyz.dll. Basically that they have the methods but have very different algorithms inside there.
What's the best way for me to do that? Right now that I'm using this:
<br />
Assembly a = Assembly.LoadFrom("abc.dll");<br />
Type mm = a.GetType("abc");<br />
object o = Activator.CreateInstance(mm);<br />
object[] par = new object[] { };<br />
ds_LUT = (DataSet)(mm.InvokeMember("GetLutTable", BindingFlags.Default |<br />
BindingFlags.InvokeMethod, null, o, par));<br />
<br />
<br />
<br />
Is there a way to keep the dll open until I am "finished" with it so I can close it and open the other dll? That will be done during runtime.<br />
<br />
Additional note: The dll are in c# language and was created in Visual Studio.Net 2005 software.
|
|
|
|
|
Without getting into additional app domains, once the DLL is loaded you will not be able to unload it. You can load more than one DLL at a time, so the idea of needing to "close it and open the other dll" doesn't really apply.
|
|
|
|
|
The only way to do this would be to have the DLL loaded into a separate AppDomain, which you could then unload. Mind you, I don't see what benefit this would bring you, as the Type would be completely different when you load up the new DLL - even if they have the same name, they really are different types so you won't have to worry about implementation collisions.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
How about letting the types within the assemblies inherit a given interface?
Then cast the instances to the interface on creation and the methods will be the same, but the implementation in the various types will differ.
-Larantz-
|
|
|
|
|
Hi........
The error is ...System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: index
My code is like this.........
phInfo is a PlaceHolder
ptoInfoData.InfoRow[] infoRow = GetInfoRow();
for (int i=0; i < infoRow.Length; i++)
{
if (! smInfoId.Contains(infoRow[i].info_id))
{
//did some coding here
Control ptoInstance = LoadControl@"~\Controls\bnInstance.ascx");
HERE NEAR THIS LINE THAT ERROR IS COMMING
this.phInfo.Controls.AddAt( i , (ptoInstance));
}
}
Thanks in advance....
|
|
|
|
|
In the line that throws the exception, i must be a valid index. This means if there are two items in the this.phInfo.Controls, then the valid values for i are 0 and 1.
This is all an assumption, since I have no insight into the phInfo.Controls type.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
First, please use the <pre> tags for code blocks like this so the formatting is preserved.
ptoInfoData.InfoRow[] infoRow = GetInfoRow();
for (int i=0; i < infoRow.Length; i++)
{
if (! smInfoId.Contains(infoRow[i].info_id))
{
Control ptoInstance = LoadControl@"~\Controls\bnInstance.ascx");
this.phInfo.Controls.AddAt( i , (ptoInstance));
}
} Have you stepped through the code in the debugger and verified that the phInfo.Controls array (or collection) is valid?
Also, what is a "PlaceHolder"? And, more specifically, what is the Controls property on that class?
|
|
|
|
|
PlaceHolder is an asp.net control.
Into this PlaceHolder I am loading another aspx page which
is having some control....
Here I am incrementing 'i' everytime but I don't want to
add everytime to the collection so inside the 'if' condition
I am trying to add to the collection. but in the 3rd iteration
it is giving this error
Can u pls tell me logically what to do .....
|
|
|
|
|
Any reason you are using the AddAt function instead of Add ? Even though you are skipping certain loop iterations, the counter is still being incremented, so when you call AddAt in the 3rd iteration there is a chance that the counter is at least 1 position higher than the Controls collection. If AddAt is passed an index that is outside of the Control bounds, it will not add it and throw the exception you are seeing. The Add function will always add to the end of the collection, so you wouldn't see this error.
|
|
|
|
|
Add will take only one argument... I need to pass 2 arguments
|
|
|
|
|
Right, Add would only take ptoInstance as the argument and add that object to the this.phInfo.Controls collection. The other argument for AddAt is the index into the this.phInfo.Controls collection at which the control should be added. You don't need this argument when using Add as it will always be added to the end of the collection.
From what I see in your code, using
Add<code> should work. <br />
<br />
<div class="ForumSig"><br />
Scott.<br />
<hr style="height: 1px; width: 100%">—In just two days, tomorrow will be yesterday.<br />
<br />
[<a href="http://www.codeproject.com/scrapbook/ForumGuidelines.asp" target="_new">Forum Guidelines</a>] [<a href="http://www.codeproject.com/script/articles/list_articles.asp?userid=157870" target="_new">Articles</a>] [<a href="http://geekswithblogs.net/sdorman" target="_new">Blog</a>]</div>
|
|
|
|
|
Thank you very much Scott. It is working...
Thanks a lot...
|
|
|
|
|
|
I'll 5 vote you seeing that he couldn't be bothered to.
Deja View - the feeling that you've seen this post before.
|
|
|
|