ASP.Net queries

krisdkiller

Disciple
May 9, 2006
142
2
79
39
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.
 

hammerhead

Adept
Jun 26, 2006
683
26
0
37
www.teamreflex.org
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.
 

shotgun

Disciple
Aug 18, 2006
196
2
28
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.
 

krisdkiller

Disciple
May 9, 2006
142
2
79
39
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.
 

hammerhead

Adept
Jun 26, 2006
683
26
0
37
www.teamreflex.org
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.
 

krisdkiller

Disciple
May 9, 2006
142
2
79
39
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

Disciple
May 9, 2006
142
2
79
39
btw thanx for the help on marquee news section. It worked. I would post my coding here 2mrrw coz I worked on it in office.
 

shotgun

Disciple
Aug 18, 2006
196
2
28
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
 

hammerhead

Adept
Jun 26, 2006
683
26
0
37
www.teamreflex.org
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.