|
Page_Validate will not fire server validation methods, it will perform the validations on the client.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
hi , i've added some labels to my webform at runtime . the "runat" attribute is set to "server" . now i want to get each label's innertext by severside controls like <asp:button>.
how to get the runtime made labels via asp?
|
|
|
|
|
If you created the controls at run time rather than in the aspx markup then you need to recreate the controls during a post back in order for them to be recognized again.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
so i cant use my ideas . thx
|
|
|
|
|
As i said, if the controls are created dynamically then they must also be recreated during apostback. There are many examples of this. Most server controls use this technique.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Correct
Wonde Tadesse
MCTS
|
|
|
|
|
As Mark said, In order to work with controls that are created in runtime, you must recreate the controls each time a postback is occurred.
Wonde Tadesse
MCTS
|
|
|
|
|
You can use it's Parent's FindControl method like this:
var lbl = document.getElementById('<%= parentConrol.FindControl('myLabel').ClientID %>');
var text = lbl.innerHTML;
|
|
|
|
|
good , but there is another problem with testing this way, the parent controls are being added runtime. and the Id of controls is identified by user at runtime too.anyway, thank u .
|
|
|
|
|
Not even close to what the OP was asking for. I guess you missed the part about server side.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
If you see the OP's response to my solution, you can infer that s/he actually meant accessing the innerHTML using a javascript method called from a button's onclick.
|
|
|
|
|
Shameel wrote: s/he actually meant
And we can infer from this that you are a mind reader. Does that make it true or correct?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark Nischalke wrote: And we can infer from this that you are a mind reader. I'm not a mind reader, but I have the mental ability to infer from the word 'innerText' in the original question that the OP wants to read the contents at the client side. Had it been server side, s/he wouldn't have used the word 'innerText'. Mere mention of a server side button does not necessarily mean that the OP wants to do it on the server side.
"Don't confuse experts with facts" - Eric_V
|
|
|
|
|
Let's break down the OPs statements
oujeboland wrote: the "runat" attribute is set to "server"
runat=server? Seems to infer the label control in question will be a server control, either and ASP.NET Label or a GenericHtmlElement of type label. Don't see any JavaScript involved here. Unless you infer some method to insert JavaScript and have the controls processed by the ASP.NET engine.
oujeboland wrote: get each label's innertext by severside controls
Oh, yes, there is mention if the word innerText. However, notice the "by serverside controls". Still can't do JavaScript on the server, unless again, you are inferring some technique for which I'm not aware of.
Now look at your inferred solution.
var lbl = document.getElementById('<%= parentConrol.FindControl('myLabel').ClientID %>');
var text = lbl.innerHTML;
The OP mentioned server-side twice and dynamically creating controls in that context. You offer a JavaScript solution.
You are using expression syntax which means embedding the JavaScript within the page so it will be processed by the ASP.NET engine. A poor design to begin with and still doesn't address the OPs needs.
We could continue this, and I have no doubt you will try, however, it doesn't change the fact you offered a poorly designed solution that doesn't address the OPs needs. What can be inferred from that?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hiiiiiiii to all
Dear sir
any one can give link where to get about THREE TIER project in ASP.NET WEBSERVICES good tutorial and and also download small project THREE TIER programming in ASP.NET WEBSERVICES
rizvan sivally
|
|
|
|
|
Ummm, a web service is one of the tiers.
Once you understand what "n-tier" actually means, you'll understand the previous statement.
Google is your friend.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Dear sir
actually i m working with tier programming with Data Layer,Business Layer,Presentation layer, with asp.net c#,if you have any link of webservices with 3 tier tutorial with small project,please send me
Thanking you
rizvan sivally
|
|
|
|
|
|
Hi,
I have an asp.net application wherein we are suppose to Mail stored items i database to clients at a particular time in a day i have constructed a task that runs when application starts using global.asax application_start function.
the logic works fine when tested on local IIS or using testing server, however when this application is deployed on remote IIS it does not work at all as no mails are send from the remote IIS. I tried below two different technique that worked well on local machine but failed remotely:
Solution 1: Using Threading model where code is as follows (global.asax)
01.
02.Thread SendEmail, CleanOld, MassMailer;
03.
04.void Application_Start(object sender, EventArgs e)
05.{
06. 07. SendEmail = new Thread(ArticleEmailTask);
08. SendEmail.Start();
09.}
10.
11.void ArticleEmailTask()
12.{
13.
14. System.Threading.Thread.Sleep(700000);
15. while (true)
16. {
17. if (DateTime.Now.Hour >= 9 && DateTime.Now.Hour <= 10)
18. {
19.
20. }
21. else
22. {
23.
24. System.Threading.Thread.Sleep(3500000);
25. }
26. }
27.
28.}
Solution 2: Using Caching Background Task where code is as follows (global.asax)
01.protected void Application_Start(object sender, EventArgs e)
02.{
03. AddTask("DoStuff", 120);
04.}
05.private static CacheItemRemovedCallback OnCacheRemove = null;
06.
07.private void AddTask(string name, int seconds)
08.{
09. OnCacheRemove = new CacheItemRemovedCallback(CacheItemRemoved);
10. HttpRuntime.Cache.Insert(name, seconds, null,
11. DateTime.Now.AddSeconds(seconds), Cache.NoSlidingExpiration,
12. CacheItemPriority.NotRemovable, OnCacheRemove);
13.}
14.
15.public void CacheItemRemoved(string k, object v, CacheItemRemovedReason r)
16.{
17.
18.
19. DoSomeFileWritingStuff();
20. AddTask(k, Convert.ToInt32(v));
21.}
22.
23.private void DoSomeFileWritingStuff()
24.{
25. clsMassMailer objMassmailer = new clsMassMailer();
26. objMassmailer.NewMassMailTask();
27.}
Kindly advice as soon as possible,
thanks in advance.
|
|
|
|
|
Add a few log statements to find out which lines of code are executed at which time. That will help to find the place where the problem really happens.
By the way, 5 minutes are 300000 milliseconds, not 700000; one hour is 3600000 milliseconds. And I'd prefer timers instead of Thread.Sleep().
|
|
|
|
|
I am just getting started in asp.net. I Wonder where I can Find Tut's for complete novice like Myself. I can do winforms in vb so I would like to expand upon this with asp.net.
Thanks in advance
Frazzle the name say's it all
|
|
|
|
|
Well, if you try to search on google, you will find a huge results with helpfull links. Like example http://www.asp.net
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
I searched on google. I found A few tut's but mostly old version's of asp.net on asp.net i watched the pluralsight videos I am eager to learn more. was hoping some guru knew of more learning sites I'll google some more.
Thank's for the reply.
Frazzle the name say's it all
|
|
|
|
|
Tut tut! Did you not think of searching the CodeProject articles? There are lots of samples to be found, and new ones added almost every day!
|
|
|
|
|
i have built a webpart controle and add it to a page
then i implement a css file to the webpart
all is OK
then i built a MobileAdapter.cs
for mobile users
the problem is that the css wasn't implemented
what can i do
|
|
|
|