|
I want to generate HTML Report....
i.e when a button is clicked on .aspx page , i want to open a html page and display the fetched data from the database....
Thanks in adv..
|
|
|
|
|
Rohit,
Which type of html control u have on ur page?
Why r u not using SQL Server to fetch the data.
|
|
|
|
|
Hi Deepak
I have to just display data on any control on HTML page
m using Sql 2005
|
|
|
|
|
Rohit,
First clear me that what page u r using .html or .aspx
If U r using .aspx page,then data can be bound to dropdown list from db by using SqlDataSource.
Is it so?
|
|
|
|
|
m using .aspx page and on the button click of .aspx page i want to display the html page , and on that html page display the data...
http://www.codeproject.com/script/Forums/Images/smiley_cry.gif
|
|
|
|
|
Do like as...
On btn click use Response.redirect("name of page to redirect to") method.
U will go to .html page. In this method u can use Query string of related data to fire query on html page to fill the data to the control on this page.
Is there any control on .htm page which support data binding property?
|
|
|
|
|
then why are you using stringbuilder use data source like datatable, fill it with the data and bind it to the controls' source.
|
|
|
|
|
i want to bind that data to an html control which is on another html page,and my html control is not on aspx page....then how should i bind ???
|
|
|
|
|
How are u managing the call to the Page?
U need to pass the data/parameter from calling page to your called page and u can handle it on the page as per your need.
|
|
|
|
|
m calling response.redirect(index.htm)
ya i need to pass data/parameter....but could not do so.....
|
|
|
|
|
are you getting any error?
|
|
|
|
|
Can u please tell me how to pass the parameter......
m not getting any error
|
|
|
|
|
use query string or sessions to pass value
Response.Redirect
("index.htm?username=" +
TextBox1.Text = Request.QueryString["username"].ToString();
|
|
|
|
|
How could i use TextBox1.Text on HTML page....
TextBox1.Text = Request.QueryString["username"].ToString(); ???????
|
|
|
|
|
So you've to manually handle/manipulate the string data by JavaScript and feed it to the control.
|
|
|
|
|
To obtained by plain HTML (no ASP.NET needed):
Although this is definitely not the best practise.
And am still not very sure if this is what you are looking for.
< html >
< head >
< title>index< /title >
< meta http-equiv="REFRESH" content="0;url=http://www.xyz.com/xyz.aspx" >
< /head >
< body >
Index page.
< /body >
< /html >
using a JavaScript code:
< html >
< head >
< title >index< /title >
< /head >
< body >
< script language="javascript" >
window.location = "http://www.xyz.com/xyz.aspx";
< /script >
Index page.
< /body >
< /html >
|
|
|
|
|
Hello All
i've a usercontrol with alot of items i want to customize it for each individual page ,for instance making some textboxes,buttons invisible in a particular page , how to?
thanks
modified on Sunday, November 8, 2009 1:39 AM
|
|
|
|
|
What is the problem. Expose some properties from the usercontrol to set it from any page.
|
|
|
|
|
check the properties of the user control you are using. Also u can add controls to it like text box etc , if it supports them and then set the properties as per you requirment. If the user control doesn't support then change to a custom aspx control as per your requirments.
|
|
|
|
|
Thank you sir , but i was thinking of having a sub that handles all the control intead of exposing each individual item , i vame up with this sub , and it works just fine
Public Sub _DisableCont(ByVal Cont_Str As String)
Dim _Control As Control
For Each _Control In Me.Controls
Dim _ControlToString As String = _Control.ToString
If _ControlToString = Cont_Str Then
_Control.Visible = False
End If
Next
End Sub
|
|
|
|
|
Just see you have already did yourself. Our main motive is to help you to solve your own problem yourself.
Just to add to your solution, if you need any particular control to do something else check using this :
If TypeOf(_Control) is TextBox Then
Dim tb as TextBox = DirectCast(_Control, TextBox)
tb.ReadOnly = True
End If
You might also take Select Case in account for this scenario.
Cheers.
|
|
|
|
|
Hi,
I have two pages in my website 1.Welcome.aspx 2.Search.aspx
Welcome.aspx has two text boxes. Keyword and Location
User types in keyword and Location and clicks Search button
User gets redirected to search.aspx page
The values of Keyword and Location is stored in session and these values are utilized in Pageload to show the values in grid in search.aspx page.
Hence the url of this page is always http://sitename/search.aspx
However in order to get higher rating using SEO methods I plan to include the
keyword and location in url like http://sitename/search.aspx/keyword/Location
How can this be done? is it possible to read values stored in session and modify the url dynamically?
WelcomePage Code
-------------------------------------------------------------
protected void On_btnSearch_Click(object sender, ImageClickEventArgs e)
{
Session["searchWord"] = txtSearchWords.Text;
Session["location"] = txtLocation.Text;
Response.Redirect("Search.aspx");
}
--------------------------------------------------------------
SearchPageCode
--------------------------------------------------------------
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
//Receiving the searchWords from the calling pages.
if (Session["searchWord"] == null)
{
Server.Transfer("Welcome.aspx");
}
else
{
txtSearchWords.Text = Session["searchWord"].ToString();
txtLocation.Text = Session["location"].ToString();
Session.Remove("searchWord");
Session.Remove("location");
}
if (!txtSearchWords.Text.Equals(""))
{
grdResultRefresh();
}
}
--------------------------------------------------------
|
|
|
|
|
Hari1919 wrote: http://sitename/search.aspx/keyword/Location
How about this
http://sitename/search.aspx?kw=seol&location=brigetown
It is easier if you show using query string bcos you can use Request.QueryString.
Otherwise you need to create one handler that might process your special request and get the values from /keyword/location.
Hari1919 wrote: he values of Keyword and Location is stored in session
You dont need to store this in session as you send already in querystring. Use
Response.Redirect("search.aspx/keyword/Location");
|
|
|
|
|
That would a lot easier............
|
|
|
|
|
Hi,
In my asp.net web form's page_load event, I want to check if the query string 'id' is there or not. If not, then transfer the user to another page. Now, I am using this code.
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["id"] == null)
{
Response.Redirect(ResolveUrl("~/Projects"));
return;
}
int x = 5;
int y = 4;
doSomething(x,y);
}
Now, my question is, DO I NEED TO CALL THE 'return' STATEMENT after Response.Redirect(ResolveUrl("~/Projects"));
call ? Wont the page automatically die after this Redirect method call ? Thanks.
|
|
|
|