I'm pretty sure thats right, one page can't inherit from another.
What you can do is have a base page class that inherits from Page (inside your App_Code directory), and have every page inherit from that. You could even have more than one base page if you have different functions you want to re-use.
Yes you are right i have done this in My project for checking Credentials and for state management with proper workflow .
But i think his requirements are different Might be he wanted some exisitng controls and function to be used in another page
Thanks and Regards Sandeep
If you want something you never had,
do something you have never done!
I am using ajax autocompleteextender. I have declared the service method in the user control itself instead of declaring it in aspx page. But the extender does not work .How can i do it? I want to declare it in ascx page,as i will be reusing the component. i am developing in vs 2005
my master page script
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" EnablePartialRendering="true"/asp:ScriptManager>
my aspx page where i am inheriting masterpage
public partial class ctlAutoExtender : System.Web.UI.UserControl
protected void Page_Load(object sender, EventArgs e)
public static string GetCompletionList(string prefixText, int count)
string sql = String.Format("select clt_tVLongNm from mclient where clt_tVLongNm like @companyname + '%'");
List<string> companyList = new List<string>();
using (SqlConnection connection = new SqlConnection("server=192.168.2.57;uid=sa;pwd=d28rg6yp;database=fnocash_report"))
using (SqlCommand command = new SqlCommand(sql, connection))
using (SqlDataReader reader = command.ExecuteReader())
please help me out, i am trying this since 2 weeks.
-- modified at 8:02 Friday 4th May, 2007
I am trying to display images in a datagrid. I can place the image control into the datagrid ok, but when it comes to retrieving the imageurl from my sqlexpress database it doesn't load the image. Can anyone help please? Below is some of the code i have already.
Hai to all,
How to get refresh the data after inserting data into database in the form,if i click on refresh button ,there is nothing happening.CAn any one suggest me with some code ,so that i can refresh after editing something on the form and database changes should be shown on the form itself.
Here i am using Navigation Buttons,after adding somvalues,i f i go for the just inserted value,it is not showing,it is giving an error like no data present.
I haven't given any code seperately for refresh.
thanks for ur reply,Here i am not using any type of Grid,Just a simple form having txt's and ddl's and label's.
Can u please suggest me some idea.How can i refresh the data which is already sent to database.THe refresh shd shown while i am navigating the buttons.The last entered record is not appearing at that perticular parse.If i close the form and if i again open,then it is coming.
I want after immediate insertion the data shd be refresh
Make autogeneratecolumns property of gridview to false.
and create <asp:BoundField> for each of the column you need to display.
This way your boolean column will display "True" and "False" in the gridview.
Now you can change this to "On" and "Off" by writing code in the "RowDataBound" event of the gridview.
protected void gvDemo_RowDataBound(object sender, GridViewRowEventArgs e)
if(e.Row.RowType == DataControlRowType.DataRow)
if (e.Row.Cells.Text == "True")
e.Row.Cells.Text = "On";
e.Row.Cells.Text = "Off";
set OnRowDataBound = "gvDemo_RowDataBound" in the gridview.
The code for your sencond problem can also be written here only cellindex will be changed.
I have a problem and I didnt find an aswer into articles.
I have a datalist, a sqldatasource and a page.
I should select some data from database and display it on the page using datalist.
I can do it.
But i should add a footer for navigation into my datalist beacause when page loaded datalist has ALL rows from query but it must be dispalying only for 20 rows on the first page, 20 on the next page e.t.c. and I would like change current page (like in a gridview).
I cant use gridview because my items should be displaing like: