|
Right click on the project -> Add new Item -> Select Master Page -> Click Add.
I'm guessing your problem is more how do you change each existing page to use the new master page? After adding the master page, go into each existing page and add MasterPageFile="~/Site1.Master" into the Page declaration at the top. After that, remove you , , tags etc from the page, add the relevant <asp:content xmlns:asp="#unknown"> tags and move the required code into each content area.
|
|
|
|
|
Thanx,
But when i did that, it again showed err, in the Line :
"f the page,
wat should i do?
|
|
|
|
|
What line errors are what is the exception?
|
|
|
|
|
Hello,
I have placed a table of 2 columns 5 rows and 4 dropdown lists and 2 textboxes in its columns. Out of these 4 dropdown lists, i have enabled autopostback property; but when i run the page and changes/select the options of this dropdown list; this control's postback do'nt fire immediately; it takes so many minutes and/or seems like hang the page. It is not on a specific item; sometime it works fast and sometime i select the items it again seems like hand / not postbacked.
Why this is like so; and how to resolve it.
Thanks & Regards
Girish Sharma
|
|
|
|
|
It may cause of very heavy viewstate text in your page. Check your page view source if yes then
google for "save viewstate in database"
Gaurav Kumar Singh
Consultant (Asp.net)
|
|
|
|
|
Thanks for your reply. Right now the page is having total 99 lines and only 1 table,2 command buttons,4 dropdown list and 2 textboxes; nothing special or higher coding (i do'nt know).
Thanks & Regards
Girish Sharma
|
|
|
|
|
How many items are in the drop downs?
|
|
|
|
|
only 7 item are there in which postback property is set to true and i need to populate / rename the items for another dropdown list as per selection in this dropdown list.
Thanks & Regards
Girish Sharma
|
|
|
|
|
What would happen if you changed the row to a single cell with a user control that has the dropdowns. You cound wrap the user control in an update panel?
|
|
|
|
|
|
HI,
I need to create link array using javascript in asp.net that means i can get the Click event from every link how to do that
|
|
|
|
|
Well, your first step is probably to look at the js that ASP.NET generates, then work out how to write something that will hook into it.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hi Guys,
I need to send and receive SMS through my asp.net application based on some changes in database
(SQL Server 2005). I am going to have one continuously monitoring process which will check any database changes and will then send the SMS to appropriate user. The process will also listen to the port if there is any new received SMS.
I have come accross many gateways available in the market like
1) Ozeki (http://www.ozekisms.com/index.php?owpn=230)
2) http://www.clickatell.com/developers/api_soap.php
3) esendex
etc. (I will not bore you with the list )
So far, I liked "Ozeki". But I want to know if anybody knows any better gateway which has been used in your applications earlier. I would also like to know your experiences on Ozeki if any of you have used it.
Your inputs will be a big help.
Thanks in advance.
Nyoti
|
|
|
|
|
Hi
In asp.net website when writting inside textboxes html tags or single cote an error is generated " potentially dangerous Request.Form value was detected from the client ".
I used to put in page directive of master page validaterequest=false and everything is ok.
I have met someone who told me that this is not secure and can cause sql injection (but iam using stored procedures) or script injection.
I have also read about enabling "Debug=true" directive at the top of the file that generated the error
I also know that we can encode our text values and save them in sql as encoded using Server.HtmlEncode(txtName.Text));
but do i have in this case to write Server.HtmlEncode and decode when reading for every textbox i have and does it have any influence on loading time, does it take time????
plz advice and thanks
|
|
|
|
|
first thing using validaterequest=false is not secure is right. It may cause of script injection but sql injection can be used. Server.HtmlEncode will protect you for script injection. about the loading time you can check your self as:
add:
<system.web>
<trace> enabled="true"
mostRecent="true"
requestLimit="50" />
In your web.config file and...
Then open trace.axd file by write in end of your url like:
http://www.codeproject.com/script/Forums/Edit.aspx/trace.axd
Gaurav Kumar Singh
Consultant (Asp.net)
|
|
|
|
|
Actually my problem is:
there are two usercontrol uc1 and uc2 in uc1 there is a input hidden value which i want to access in uc2
can anyone tell how to access that...
I tried with Page.FindControl, Master.FindControl, Master.Master.FindControl but nothing seems to work.... all gives null references.... values is null...
Any suggestions is most appreciated......
Please if have any idea do get me posted as early as possible!!
Paritosh Tripathi
B.Tech. (C.S.)
BrainTechnosys Ltd.
modified on Thursday, April 23, 2009 7:01 AM
|
|
|
|
|
Hi Paritosh,
The link below may provide solution for your problem.
http://www.dotnetfunda.com/articles/article201.aspx
This worked fine for me.
Regards,
Nyoti
|
|
|
|
|
Hi Nyoti
Thanks for your reply
But actually i didn't specified that my page is a dynamic page which is created at runtime and now i want to access a usercontrol's hidden input in other usercontrol.
SO the main problem is that page in which the usercontrols are show is dynamic and usercontrols are also dynamically loaded onto the page.
Paritosh Tripathi
B.Tech. (C.S.)
|
|
|
|
|
OK.
In this case, you can add dynamic events at the time of Control Creation and write handlers for them.
|
|
|
|
|
Can elaborate it a bit.....
coz i've not done this kinda task before so ifu could explain it with any example would be of grr8 help...
Paritosh Tripathi
B.Tech. (C.S.)
|
|
|
|
|
ok. Are you able to execute the events in your user controls?
If not, then you need to do something like this.
EventInfo SomeEvent = AnyControlInYourUserControl.GetType ().GetEvent("Click");
SomeEvent .AddEventHandler(AnyControlInYourUserControl, new EventHandler( this.AnyControlInYourUserControl_Click));
Write a handler for this.
But I think, you are already executing postback, however, since the page is dynamically being created, on post back you are loosing the value of the hidden variable. So in the event handler function above you can store the value of the variable in the session and then can access it.
I am sorry, if I misunderstood anything. I will post the code tonight if you want.
Thanks,
Nyoti
|
|
|
|
|
Hi Nyoti,
No no you've been of grr8 help but actually i'm not able to get the usercontrol
i mean the page is dynamic and controls in it are dynamic.
Ok i'll explain it ..
I've a dynamic page which has a 2 panels in each panel there are usercontrols 1 control shows the articles and other has a review
for every article user can post review and that review details are stored in database now problem is when i'm saving the details i need the article id so that i can link the reviews with the articles. i've already taken a input hidden value in which i'm storing articleid in codebehind
now i want that article id in the review usercontrol so on submit button click i can save the article id (uniquidentifier) into database along with review details.
Hope now you can get exactly what i'm trying to do...
Now i want the usercontrol id so i can findcontrol inside it and can find the htmlinputhidden value..
thanks in advance.
I'm sure you'll be ready with solution to this problem.
Sorry to trouble you so much but really stuck with this problem so favour needed.
Paritosh Tripathi
B.Tech. (C.S.)
|
|
|
|
|
Dear All,
I need some advise how to make a website like SCRIBD or Google Books, what tools I need.
Thanks
|
|
|
|
|
I suspect from your question this project is doomed. If you don't even know what tools you need then how do you expect to have the knowledge to use them in a complex project?
Aim lower to start with, then build up to more complicated things.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Good day!
I read several acticles about getting the "users online count" and "registered users count". However most of them were not full or lack performance. So i decided to make my own logic and i would like to share it with you. Can you please comment on it ? Is my logic wrong ?
Get registered users count:
DB logic:
- Store the count in a special table on the SQL server as a parameter. Increment the count when a new user is created. Decrement count when user is deleted ( or expired ). There is an alternative to SELECT COUNT(*) FROM Users...... but i discarded it. I don't think it's the best way to achieve my goal.
Get online users count:
DB logic:
- Store session information in a special table on the SQL server. Update the table whenever an activity is idicated ( the important here is the LastActiveDate and ExpirationDate ... which determine if the session is expired ).
- Logic for purging expired sessions and return the online users count after the purging.
ASP.NET
Web Server logic:
Web the application is started ( Application_Start Global.asax ) i start a System.TIMERS.TIMER with interval of 10 minutes. Every 10 minutes i get the registered users count, purge the expired sessions , get online users count and keep the stored data as static. On Application_End i dispose the timer.
However all my web forms are inherited by a base form in which "Page_Load" handler i idicate an activity and update the session information table on the sql server.
I'm not quite sure if my logic is right about all those steps. Please comment.
Best wishesh , Hristiyan
|
|
|
|