|
1. First, get the url count from db and create as much as links dynamically you want.
2. Assign the text and url address appropriately.
Hope this helps.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Hi,
It would be better if you type the code, so it might be easy for us to tell whats wrong with it or what u find difficult.
Solution: Fetch What news has to be shown from database and then assign to text property of a Link Button.
|
|
|
|
|
Hey Thanks to both
But suppose in DB there r 20 entries then for this i have to create 20 LinkButtons or Hyperlinks.....
So it will get complicated.
1) I want to do is that first we write coding for calculating the number of entries in Db table.
2) Then corresponds to that entries, it will generate that number of link buttons..
Isnt it?
|
|
|
|
|
you can use the repeater control.
|
|
|
|
|
I tried to create one LinkButton. Used this code.
Dim hlink As LinkButton
Dim sw As System.IO.StringWriter
Dim htw As HtmlTextWriter
hlink = New LinkButton
hlink.ID = "ZoneLink"
hlink.Text = "TestButton"
sw = New System.IO.StringWriter
htw = New HtmlTextWriter(sw)
hlink.PostBackUrl = "Default2.aspx"
hlink.RenderControl(htw)
Response.Write(sw.ToString)
But only displays the text. No hyperlink is displayed ?
|
|
|
|
|
Use this code (is in c#):
Literal lit = new Literal();
lit.Text = @"<a href=""Default2.aspx"">TestButton</a>";
lit.RenderControl(htw);
Response.Write(sw.ToString());
|
|
|
|
|
This method is not causing the postback event.
|
|
|
|
|
Ok then try this:
LinkButton hlink = new LinkButton();
hlink.ID = "ZoneLink";
hlink.Text = "TestButton";
hlink.PostBackUrl = "Default2.aspx";
form1.Controls.Add(hlink);
|
|
|
|
|
Thanks for the reply darkcalin.
The thing is that they have created one user control which gets html tags as input and prints a table. But I I add this to form , my problem is not solved.
What I am doing is that creating a control and and rendering its contents to html page.
Hope I am clear now
|
|
|
|
|
Try this:
HyperLink hlink = new HyperLink();
System.IO.StringWriter sw = new System.IO.StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
hlink.ID = "ZoneLink";
hlink.Text = "TestButton";
hlink.NavigateUrl = "Default2.aspx";
hlink.RenderControl(htw);
Response.Write(sw.ToString());
|
|
|
|
|
This one I have Already tried. The things is that the HyperLink is Not Causing the CrossPage postback. I need cross Page PostBack
|
|
|
|
|
For moment i don't have any idea. Could you please write more code here to see how can we fix that
|
|
|
|
|
|
Im trying to put my ASP.Net application online but I just keep getting "You are not authorized to view this page" errorpage (error 401.1).
Heres what i have done:
-Placed the complied ASP.net application and its files to D:\mypage\
-Created a virtual folder in IIS 5.1 called mypage and selected correct ASP.Net version (2.0.50727)
-Directory security is set to anonymous access (using IUSR_machinename). No integrated windows logon is selected.
Now when i try to open from client side http://client IP/mypage/ i get "You are not authorized to view this page".
Im out of ideas. When I did the same on my local host everything worked fine.
Thax in advance
|
|
|
|
|
In my website I want to give a feature to admin, that:
1. It can create an HTML content (including images) for a page and then save it.
2. Admin can create any number of such pages and mark them as active/inactive.
3. When a user logs in any random active page is displayed as her home page.
Can anybody suggest how should it be done.
Any help is greatly appreciated.
Thanks.
|
|
|
|
|
I think you then need to store the html in database and a handler that handles the aspx extension should be used to call the database for the page based on some id.
|
|
|
|
|
Would it possible to get a suggestion on which HTML editor be the best to use in this case.
Also, if I write a handler for aspx pasges wouldn't it affect functioning of other aspx pages.
|
|
|
|
|
joindotnet wrote: get a suggestion on which HTML editor be the best to use in this case.
There are lots of free html editors available over NET. .You can use anyone.
joindotnet wrote: I write a handler for aspx pasges wouldn't it affect functioning of other aspx pages.
Yes it would affect.. All the requests would be redirected to your custom handler. Just just need to Server.Transfer to the existing aspx files(if not from database).
|
|
|
|
|
I think writing a handler could cause configuration problems, my website is very large.
Is there any other suggestion for this.
|
|
|
|
|
i m using createuserwizard control with custom database.
i have hosted the same database and the application on two different machine (e.g one on my developing machine and another is testing machine) for testing purposes.
Now what happen when i create user using my machine database and application then works fine. but when i create user using my application and another machine database then user is created but when i login using another machine application and database it does not responded.
is there any application associated with users??
One person's data is another person's program.
--J.Walia
|
|
|
|
|
Can u tell me the solution of this problem?
I am using GridView control to display data from AccessDataSource.
Is it also possible to edit the data in GridView Control while running the application?
Can I insert, delete and update data in the databse using these 2 controls?
One more thing I want to ask is:
I want to add one column in which I want to show a checkbox. and I want to update it while running in database.
plz help me as I am a newbie.
thanks
|
|
|
|
|
|
To all your Questions , the Answer is "Yes"
For the last Question , you can add a templateField and Add a Checkbox. like this
<asp:TemplateField HeaderText="Parent" SortExpression="Parent">
<ItemTemplate>
<asp:DropDownList ID="drplstparent" runat="server" BackColor="Transparent">
</asp:DropDownList>
< / ItemTemplate >
< / asp:TemplateField >
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
i ve take two textboxes so i want to compare both textboxes value and print a message that value not same like this with javascript so plz help me soon??????
thanks and regards vivek
|
|
|
|
|
Use CompareValidator with dialog mode
Regards...
- Amit Kushwaha
|
|
|
|