ASP.Net queries

krisdkiller

Disciple
Hi,

I have few queries in ASP.Net 2.0 and am looking for help ^_^

1) Can I turn a Default page into a Content page and link it with Master Page? If I can then how?

2) I am creating a Marquee News section for my website. Now i want to change the news on daily basis. For that I have created a Admin login. After I login with the Admin account, I will be able to see a spl. button.When I click the button I go to a different page Where I can see Rich Text box and few other controls.

Now what I want to do is, What ever I write in my rich text box, that should replace my old news and should stay there till the time I dont change it.

Thanx in advance.

I would be posting all my asp queries in here.
 
I am not sure about your first question but the second one seems pretty easy if you are using a database.

Create a table that stores the data to be displayed when a normal user visits the website. At that time a read operation will be performed on the database and displayed on the users browser. When you log in as the admin, in the event of submitting the text entered in the rich text box, update the changes to the database table using a update SQL query.

That way the text will be modified and the new content will be displayed if a user visits the website.
 
1. The process is, First you design a master page -> then use that master page into a content page -> set the new content page as default page. :)
you can do reverse also, but it could be a bit tricky.

2. you can use number of options to store your data. if you require data to be available even after server or application shutdowns, you will have to store it in a persistent store. (database/file) otherwise you can store that in in Memory options (application/session/cache) available in AsP.Net

hope it helps.
 
ok i will give it a try as far as the 2nd query goes.

But,

Ill put up my 1 query again.

I have a normal page and a master page. Now i want to turn my normal page into a content page dynamically and link it with master page.

By dynamically i mean thru coding.
 
I am still not sure but you can link using simple hyperlinks that will be hardcoded in the normal page. The destination of the hyperlink would be that of the master page. You however need to decide where the "dynamic" content is coming from. The usual approach is using the database.
 
k am sorry if u are not able to understand my posts.

What i want to say is, I have a Default.aspx page in my project and a MasterPage.master

I dont have a Content page coz I want to turn my Default.aspx page to a content page on click of a button.

So is it possible to add <asp:content> tag to my source file on click of a button. Or in other words is it possible to turn my Default.aspx into a content page?
 
krisdkiller said:
k am sorry if u are not able to understand my posts.

What i want to say is, I have a Default.aspx page in my project and a MasterPage.master

I dont have a Content page coz I want to turn my Default.aspx page to a content page on click of a button.

So is it possible to add <asp:content> tag to my source file on click of a button. Or in other words is it possible to turn my Default.aspx into a content page?

while im still trying to understand your question .. :S
why dont you leave the technology part aside (master page - content page), and write the requirement here.
Master page and content page works similar to Class inheritance, i.e. Design time inheritance in ASP.Net.
inheritance is design time. and you wrote that you wanted to change that dynamically - via code - thats at run time .. :S

:ashamed: I am wondering what kind of application requires this.
post the functionality you r trying to address, and maybe then i can help, the solution might be altogether different.

Cheers
 
krisdkiller said:
k am sorry if u are not able to understand my posts.

What i want to say is, I have a Default.aspx page in my project and a MasterPage.master

I dont have a Content page coz I want to turn my Default.aspx page to a content page on click of a button.

So is it possible to add <asp:content> tag to my source file on click of a button. Or in other words is it possible to turn my Default.aspx into a content page?

I am sorry I can not help you out with that. It has been quite some time since when I last programmed ASP.NET.
 
Back
Top