|
|
do u want to remove it programatically or by simpling clearing the history of the browser.
Vipin
|
|
|
|
|
I want to clear it by programatically(C# or JavaScript).
Thanks
|
|
|
|
|
Hi.. Good Day..
I have a question about how to get different field values from database and combine both of these values and display it in the textbox.
I use the SqlDataReader to read data from database. The way i use to assign data from database into textbos is like below :
txtBookTitle= myReader.GetValue(2).ToString
Can anyone give me a solution how to combine 2 values get from database and dispaly out in a textbox. Thanks....
Best Regards,
Pei Sun
|
|
|
|
|
txtBookTitle.text = myReader.GetValue(2).ToString() & myReader.GetValue(2).ToString()
That should concatenate two strings. For numbers, you should cast to the number and use a + sign instead.
|
|
|
|
|
Thanks for your help. it's work ! Thanks so much..
Best Regards,
Pei Sun
|
|
|
|
|
I hav a DataView object named dv. It gets its data from a DataTable named tbl.
It has three columns: col1,col2,col3. I populate a ListBox object named lstItems from it in the following way:
...
Dim dv As New DataView
dv.Table=tbl
lstItems.DataSource=dv
lstItems.DataValueField="col1"
lstItems.DataTextField=DataBinder.Eval(dv,"col2,col3")
lstItems.DataBind()
It want col2,col3 values to be displayed in as a single item listbox.
it gives error on reaching to DataBinder.Evel() method.
Can someone help me how to solve this problem.
Thanks
|
|
|
|
|
You can use the DataBinder in this way as the DataTextField is where you specify a single data field. IMO, your chances are:
+ Manage to add the ListItem in the Items collection and you can combine the two columns.
+ Rearrange the datasource to have a column that is the combination of the two columns.
|
|
|
|
|
|
|
you can write a function to combine the two fields with comman and then use that function in DataTextField.
like,
string Combine(object o1, object o2)
{
return o1.ToString() + "," + o2.ToString();
}
you can use
lstItems.DataTextField = Combine(DataBinder.Eval(dv, "col2"), DataBinder.Eval(dv, "col3"));
Thanks,
Pradipta.
Pradipta Basu
|
|
|
|
|
Hi all,
I want to store contents to database from Textarea, Sometimes the user put's the HTML tags in the textarea, this makes a little confusion in the design while retriving the data. Is there any options to remove all the HTML tags before storing the data's in the database?, I am doing this work in ASP.NET with VB.NET.
Please guide me.......
Regards
Exelio
|
|
|
|
|
Hi there,
The common way is to keep saving data as it is in DB, but when you display on the web page you can use the HttpUtility.HtmlEncode encode the html markup in data.
|
|
|
|
|
Before doing it you have to write ValidateRequest="false" in the page directive.
The problem is that it provides an option for HTML injection.
Pradipta Basu
|
|
|
|
|
Hi everybody!!
I want to play some audio files in my project. Audio-Files should be stored in database , first it will read from databse then play this file.
Can anyone tell me how to do this.
Thanx n regards
|
|
|
|
|
Hi there,
Basically, to play the media file on the web page you can host the player on the page with the object tag, and assign the url of the media file to the player. You can use the search functionality of the site to look for the sample code as this question was answered many times at this site.
|
|
|
|
|
Pls help me understand why is that when using server.transfer the previous page is displayed in the url address of the browser.
For example, login.aspx is displayed in the browser. When login button is clicked, server.transfer(mainmenu.aspx) is called.
When the mainmenu.aspx is displayed on the browser, the url address displayed
is still the url of login.aspx. Becaus of this my sitemap is having problems in getting the correct current node. Pls help. Thanks.
|
|
|
|
|
The Server.Transfer method redirects the web page at the server side, so it does not update the new url in the address bar. In this case, you might consider using the Redirect method instead.
|
|
|
|
|
ok thanks. for the explanation.
|
|
|
|
|
Server.Transfer transfers page processing from one page directly to the next page without making a round-trip back to the client's browser. This provides a faster response with a little less overhead on the server. Server.Transfer does not update the clients url history list or current url. If u want to update ur url address it is better to use Response.Redirect();
eg.Response.Redirect("mainmenu.aspx");
|
|
|
|
|
Hi Thanks for the reply.
But is there a way for my sitemap to get the correct node even if I use Server.Transfer? Below is the code I used to resolve SiteMap in Global.asax.
Function AppendQueryString(ByVal o As [Object], ByVal e As SiteMapResolveEventArgs) As SiteMapNode
If (Not (SiteMap.CurrentNode) Is Nothing) Then
Dim temp As SiteMapNode
temp = SiteMap.CurrentNode.Clone(True)
Dim u As Uri = New Uri(e.Context.Request.Url.ToString)
temp.Url = (temp.Url + u.Query)
If (Not (temp.ParentNode) Is Nothing) Then
temp.ParentNode.Url = (temp.ParentNode.Url + u.Query)
End If
Return temp
Else
Return Nothing
End If
End Function
Thanks in Advance
|
|
|
|
|
because Server.Transfer is transfer the server from one page to another and actuaaly it is to handle the server side control not the client side controls.
and change of url is just cilent area of web-application
better to use
Response.Redirect(http://localhost/WebApplication1/WebForm1.aspx");
Mairy
|
|
|
|
|
Thanks everyone!
|
|
|
|
|
I have a follow-up qs though!
is there a method or function in asp.net for setting the browser features
same as window.open?
Thanks in advance.
|
|
|
|
|
I've come across this odd behavior, that I'm not quite sure what to make of it, or even how to determine the source of the problem.
Ok, I have one page.
3 different buttons on that page.
asp:Panel ID="PanelNew" runat="server" Width="97%" >
asp:button runat="server" text="MostRecent" OnCommand="SelectActiveView" CommandArgument="MostRecent" CommandName="Hide" />
asp:button runat="server" text="Most Recent 2" id="testbutton" />
/asp:Panel>
Then I had code in the page load that is:
<br />
<br />
testbutton.Command += new CommandEventHandler(this.SelectActiveView);<br />
testbutton.CommandArgument = "MostRecent";<br />
testbutton.CommandName = "Hide";<br />
<br />
Button TempButton = new Button(); <br />
TempButton.Text = "Cancel";<br />
TempButton.Command += new CommandEventHandler(this.SelectActiveView);<br />
TempButton.CommandArgument = "MostRecent";<br />
TempButton.CommandName = "Hide";<br />
PanelNew.Controls.Add(TempButton);<br />
So, I have on that's declared in html, one that's declared in html then modified from code, then the last is complete code made, all three buttons end up having the same command arguements, but the one made from code behaves differently from the rest. The function they call, modifies some hiden value fields then calls a page load.
Ok, now this part, is hard to explain, so please stay with me.
If I go straight to that page from a link, all three buttons work, first try.
If I click on a button that does a post back on to the page, then I click on the tempbutton, the hidden field values are not updated, Then I click the same button a second time and it does update the hidden values like it was supposed to on the first click.
Well, I hope that made sense. If it didn't then post that and I'll see if i can post some source code to duplicate this behavior.
Drathmar
|
|
|
|