|
Hi,
How can I create ASPX pages on the fly ?
I know that this can be done using Reflection, but can any body point me to a good sample ?
Also, what should I consider if I have to deploy these pages to some server ?
What would you advice me for serializing these pages ? Flat ASPX files or assemblies (DLL) ?
Hope for the best suggestions.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
I actually solved this problem earlier.
My solution worked because I used the same C# code file on each of the aspx pages. I'm sure it could be done otherwise, but it was easy to do that way.
What I did was create a base aspx file that had all the things the aspx file would need with a specific comment where the changing data would be.
I then used a streamreader and streamwriter to go through the two files. When the file got to the comment it would then use a different stream reader for that sections contents, and then continue to read the rest of the base ifle.
There might be an easier solution, but this worked fine for me.
-ken
|
|
|
|
|
Hi
I am working on a portal which is exactly the same as this one like a discussion forum internal to our org you can say. Here i have a requirement where users internal to our org will use it.
When the user connect to our portal, we want to show on the page a welcome message EX: " Welcome Santhosh..."
I suppose this information is fetched from AD. Can we have a code with similar requirements written for any of you. I have to do it, but i have very little time frame and it is the added requirement at the end.
You may want to share the code if it is ok with any of you.
Thanks in Advance!
Santhosh
Santhosh Kumar Edukulla
|
|
|
|
|
hello
i had made a crystal report and want it to add into my page when i add it int the table it work proper but when i keep compiling the website it added Style sheet refrence in to my Source. and when i put any other control into table the crystal report is shown in proper....
wasim khan
|
|
|
|
|
Is there any way to access the System.EventArgs of a Click event from the Page_Load event?
My problem is as follows: I have a page which is constructed of usercontrols (ascx), so I have a menu usercontrol, another navigation control and a main content control.
The problem is when I click on a menu item (in order to navigate to another page), the Page_Load event is fired for every usercontrol in the page before the ItemClick event is fired for the menu control, and as a result the main content page loads again, and only after that when the click event fires, the user is redirected to a new page. This basically introduces an unnecessary processing of the page I'm navigation away from.
I have hacked my way by interpreting who has postbacked the page in the Page_Load of the menu control, but I need access to the EventArgs of that method.
I've managed to get the ID of the element sent as event argument using Page.Request.Params["__EVENTARGUMENT"] but I need the whole object.
Any ideas?
Cheers,
Mircea
"Pay people peanuts and you get monkeys" - David Ogilvy
|
|
|
|
|
Hope this will help you to solve your problem.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Thanks, but I don't see how ViewState could help me. I'm not trying to persist a state. I just want to get a reference to the EventArgs of processing events (Click in my case), from the Page_Load method (which fires before the processing events).
Cheers,
Mircea
"Pay people peanuts and you get monkeys" - David Ogilvy
|
|
|
|
|
Ok i will try to work it out your problem and get back to you in few minutes.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
The event arguments for the event doesn't exist when the Page_Load method is run. They are created when the event handler for the click event is called.
What data from the event arguments is it that you need?
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
The menu is a Telerik usercontrol called radMenu. The items of the menu are objects that contain different properties (on the serverside) and are rendered as tables after the page loads.
When clicking on a menu item a Javascript like __doPostBack(telerikControlID,itemID) is called.
where itemID is the ID of the table that contains the items. What I need to access is a property of that menu item clicked. The itemID isn't helping me and the needed property is not rendred in the page. So I need to somehow recreate the objects based on their IDs like the framework does.
Do you have any idea how I could do that?
Cheers,
Mircea
"Pay people peanuts and you get monkeys" - David Ogilvy
|
|
|
|
|
OleDbDataAdapter Adapter = new OleDbDataAdapter(" SELECT Flight_ID from FlightMaster where DateOfFlight='" + Date() + "' Order By Flight_No", aConnection);
DataSet dst = new DataSet();
Adapter.Fill(dst, "Flight");
for ( i = 0; i < dst.Tables[0].Rows.Count; i++)
{
string flightid = dst.Tables[0].Rows[i].ItemArray[0].ToString();
OleDbDataAdapter Adapter1 = new OleDbDataAdapter(" SELECT Count(BagTag) AS bag1 FROM baggageMaster WHERE Flight_ID=" + flightid + "", aConnection);
DataSet dst1 = new DataSet();
Adapter1.Fill(dst1,"BaggaeMaster");
OleDbDataAdapter Adapter2 = new OleDbDataAdapter(" SELECT Count(BagTag) As bag2 FROM baggageStatus WHERE Flight_ID=" + flightid + "", aConnection);
DataSet dst2 = new DataSet();
Adapter2.Fill(dst2);
allflightGV.DataSource = dst1 + dst2;
allflightGV.DataBind();
}
The code is some like that. 1st dataset will give some values suppose 10 and for loop will run from 0 to 10 . now 2nd and 3rd dataset will give 2 values each time till loop end. I want to insert that 2 values in each row of Gridview. I know this code is not proper . Plz can any one provide me solution to this problem . Thanks to all there .
hi
|
|
|
|
|
Is this what you are looking for? Notice the datarow declaration that reverences the gridview rowindex.
<br />
<br />
foreach (GridViewRow gvRow in GridView1.Rows)<br />
<br />
{<br />
<br />
DataRow drBUPLeadBullet = BUPLeadData1.BUPLeadBullet.Rows[gvRow.RowIndex];<br />
<br />
<br />
<br />
drBUPLeadBullet["BulletText"] = ((TextBox)GridView1.Rows[gvRow.RowIndex].FindControl("tbBulletText")).Text;<br />
<br />
drBUPLeadBullet["BulletLink"] = rep.YourSessionID(((TextBox)GridView1.Rows[gvRow.RowIndex].FindControl("tbBulletLink")).Text);<br />
<br />
drBUPLeadBullet["BulletMetricIndicator"] = ((TextBox)GridView1.Rows[gvRow.RowIndex].FindControl("tbMetricTag")).Text;<br />
<br />
<br />
<br />
<br />
<br />
CheckBox cbControl = ((CheckBox)GridView1.Rows[gvRow.RowIndex].FindControl("cbPopup"));<br />
<br />
<br />
<br />
if (cbControl.Checked)<br />
<br />
{<br />
<br />
int intValue = Convert.ToInt16(((TextBox)GridView1.Rows[gvRow.RowIndex].FindControl("tbPopupLinkHeight")).Text);<br />
<br />
drBUPLeadBullet["BulletLinkPopup"] = 1;<br />
<br />
drBUPLeadBullet["BulletLinkHeight"] = Convert.ToInt16(((TextBox)GridView1.Rows[gvRow.RowIndex].FindControl("tbPopupLinkHeight")).Text);<br />
<br />
drBUPLeadBullet["BulletLinkWidth"] = Convert.ToInt16(((TextBox)GridView1.Rows[gvRow.RowIndex].FindControl("tbPopupLinkWidth")).Text);<br />
<br />
}<br />
<br />
else<br />
<br />
{ <br />
<br />
drBUPLeadBullet[<br />
<br />
"BulletLinkPopup"] = 0; <br />
drBUPLeadBullet[<br />
<br />
"BulletLinkHeight"] = 0; <br />
drBUPLeadBullet[<br />
<br />
"BulletLinkWidth"] = 0; <br />
}<br />
<br />
<br />
<br />
}<br />
<br />
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Hi,
I want to display the button (html and ASP:Button) in triangle shape. Is there any possibility is there?
Thanks in Advance
Good Is Not Good When Better Is Expected.
|
|
|
|
|
Get it
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Have a look at the ImageButton control.
"On one of my cards it said I had to find temperatures lower than -8. The numbers I uncovered were -6 and -7 so I thought I had won, and so did the woman in the shop. But when she scanned the card the machine said I hadn't.
"I phoned Camelot and they fobbed me off with some story that -6 is higher - not lower - than -8 but I'm not having it."
-Tina Farrell, a 23 year old thicky from Levenshulme, Manchester.
|
|
|
|
|
I've uploaded my ASP.Net web site.also my sqlserver2000 database.
I uploaded it via generating a script from my database in enterprise manager and executing it (SQL file)by Query analizer.(seemingly it was uploaded completely)
but when I open the website and go to the webpage that it works with db the gridview isn't displayed.(the webpage itself is displayed and it doen't have any error or exception)
my question is:
1:what is the problem in your opinion?
2:how can I be sure that the database was uploaded correctly?
|
|
|
|
|
Is there any data in your database? Is your connection string right?
If you want to check your DB is up properly, and you can connect to it with query analyser, which you seem to be able to, then you could just run a few queries on it, or look at it in the object browser?
|
|
|
|
|
yes you're right.
just the tables were uploaded but not data.
could you plz say how should I uploade data?
maybe my way for uploading wasn't true?should I do anything else?(other scripting the database and executing it by query analyzer)
thanx in advance
|
|
|
|
|
i have a problem with crystal report in desktop application.
i setup a manual refresh button to refresh the crystal report but the data isn't refreshed when i click the manually created refresh button but when i clicked the button which exixts on the crytal report i found the desired result.
KnightGuy
|
|
|
|
|
Have you tried re-directing visitor to the page itself using either "Respone.Redirect" or an HTML (or JavaScript) redirect? That's one way to force the viewer to refresh.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
I've uploaded my asp.net website.and also uploaded it's sqlserver database.(seemingly it was uploaded completely)
but when I open the site it doesn't work(it doesn't make any error or exception and open the webpage but dosn't display the the gridview)
my question is
1:what is the problem in your opinion?
2:how I can be sure that I uploaded the db correctly?
(plzzzz help it is very necessary)
|
|
|
|
|
Don't repost
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Hi i have written the code below, its job is to bring up a popup when a button is clicked,
the popup doesnt work and i doubt it is taking across "WorkSchedule_ID" I tried this but it didnt work, I reckon the offending line is "strPrimaryKey =e.Item.DataBind("WorkSchedule_ID").ToString;". WorkSchedule_ID is coming from the database and each recored has its on unique ID, how can i pass it through to the page?
protected void btnModify_Click(Object sender, DataGridCommandEventArgs e)
{
if (e.CommandName == "Submit")
{
string strPrimaryKey = (string)e.CommandArgument;
strPrimaryKey =e.Item.DataBind("WorkSchedule_ID").ToString;
//int intPrimaryKey = Convert.ToInt32(strPrimaryKey);
strEvent = "<script language='javascript'>\r\n";
strEvent = strEvent + "popup('sow_notes.aspx?WorkSchedule_ID=" + strPrimaryKey;
strEvent = strEvent + "&survey_id=" + Request.QueryString["survey_id"].ToString();
strEvent = strEvent + "&sow_type_id=" + Request.QueryString["sow_type_id"].ToString();
strEvent = strEvent + "&surveytype_id=" + Request.QueryString["surveytype_id"].ToString();
strEvent = strEvent + "&property_id=" + Request.QueryString["property_id"].ToString() + "');\r\n";
strEvent = strEvent + "</script>";ViewState["sEvent"] = strEvent;
}
}
|
|
|
|
|
hi,
i had a gridview to insert records into database i created detailsview here i had to update textbox when DropDownList's selected item is changed.i,e if i click an item in dropdownlist that item has to be displayed in textbox of detailsview
waiting for ur replies
|
|
|
|
|
Hi.how are you?
I have created a Form which has textbox,combobox,radio button and ...
the customer can view it and fill it.then by clicking the "send"button it should be sent to my email address.
I should see all the data of the application form,or the origina html application form in my inbox so I can reply the person...
How can I do it ? I dont know how to pass the data in the form to my inbox via email ...
please help me. i need the data and filled items in the application in my inbox email.
thanks alot
usinh asp.net1.1 & C#
|
|
|
|