|
I am trying to handle exception(basically I am entering exception details in database) in Page_Error Event of master page also for some child pages I need to have some different exception handling. So if Page_Error in both places duplicate data is going to be inserted in database. So can any one have any Idea to override Page_Error event of master page in Child Page.
Thanks....
|
|
|
|
|
Khadir009 wrote: So can any one have any Idea to override Page_Error event of master page in Child Page.
Yes, it's called Structured Exception Handling. Use try/catch blocks to handle the exception at the lowest level and bubble them up when, and if, necessary.
only two letters away from being an asset
|
|
|
|
|
Thanks man!! Just I need to throw exception on child page or i need to handle it another way, instead this I am trying to override events on master and child. My problem solved, thanks once again....
|
|
|
|
|
I have a ASP.Net Report viewer runniong a report that displays the corredt number of rows but the cells arenot showing data. Any ideas? When I run the query in server explorer, I see the data and the number of rows on the report match that.
|
|
|
|
|
Hi Every body
I'm a prgram writer
now in want learn insert ,update,delete and select in with ADO.EF.
I heard about ADO.net EF but I don't know what is it.Please tell me about it and tell me about (insert ,update,delete ) in it.
Best Regards
You are win if you want
|
|
|
|
|
what do you want to do?!
correct your Signature:You can win if you want.
|
|
|
|
|
Hi
In Ahange Modern talking boode.doroste.eshtebah nist.
dar morede ADO.net Entity frame work chzimidooni ke komakam koni
(This is a statemet of Modern Talking music)
m.profess.mrn@gmail.com
Best regards
You are win if you want
|
|
|
|
|
There is a wonderful tool available to you called the Internet. Try searching it.
only two letters away from being an asset
|
|
|
|
|
I have a listbox.
I have used datasource attribute to add items into the listbox. This code
DropDownList1.DataSourceID = "datareader";
DropDownList1.DataTextField = "tenCV";
DropDownList1.DataValueField = "maCV";
DropDownList1.DataBind();
lstChucNang.DataSourceID = "SourceListBox";
lstChucNang.DataTextField = "tenCN";
lstChucNang.DataValueField = "maCN";
lstChucNang.DataBind();
Now I want to get seletedItems from that listbox. So, How can I do?
I have ever tried to use selectedItems attribute but not.
Please, help!
|
|
|
|
|
foreach(ListItem item in lstChucNang.Items)<br />
{<br />
<br />
if(item.Selected)<br />
<br />
{<br />
<br />
}<br />
<br />
}
Hope it will help you
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
|
Your concretely question is...?
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
can i access master page variables from appcode files if yes please give me a suggestion
|
|
|
|
|
amarnath n.n wrote: Subject: please ans me
This should not be the subject. You have to ask the qestion in proper way.
amarnath n.n wrote: can i access master page variables from appcode files if yes please give me a suggestion
In App_Code , you should have classes. So make the Public Property Over There, Create object App_Code Class and Asign the Value from Master page. Then you will get variable value on you App_Code .
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
sorry,excuseme!!!
my actual question is how to access controls in master page from appcode class
|
|
|
|
|
The non nasty way to do this, is to have a class derived from Page, which returns a strongly typed version of your master page derived class, instead of just the base master. Then you can access the proprties of the master page neatly in any page derived from your new base class. A new base class lets you define all sorts of things and make them visible to all pages, as well as putting any code to check if a user is logged in, in one place.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class SampleMenuPage1 : System.Web.UI.Page
{
private const string BASE_PATH = "~/DynamicControlLoading/";
private string LastLoadedControl
{
get
{
return ViewState["LastLoaded"] as string;
}
set
{
ViewState["LastLoaded"] = value;
}
}
private void LoadUserControl()
{
string controlPath = LastLoadedControl;
if (!string.IsNullOrEmpty(controlPath))
{
PlaceHolder1.Controls.Clear();
UserControl uc = (UserControl)LoadControl(controlPath);
PlaceHolder1.Controls.Add(uc);
}
}
protected void Page_Load(object sender, EventArgs e)
{
LoadUserControl();
if (IsPostBack)
{
//Sleeps for 1 Seconds
//A Fake Deley to show the UpdateProgress/ModalPopup
System.Threading.Thread.Sleep(1000);
}
}
protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
{
MenuItem menu = e.Item;
string controlPath = string.Empty;
switch (menu.Text)
{
case "Load Control2":
controlPath = BASE_PATH + "SampleControl2.ascx";
break;
case "Load Control3":
controlPath = BASE_PATH + "SampleControl3.ascx";
break;
default:
controlPath = BASE_PATH + "SampleControl1.ascx";
break;
}
LastLoadedControl = controlPath;
LoadUserControl();
}
}
In SampleControl2.ascx ..Even is not firing for first time(dropdown onchange event)
And !ispostback is not working
Ramkumar
|
|
|
|
|
Dude,you already posted your code in previous question.
Be patient and wait for answer.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
Hi.
just a thought.
As you told event is not firing on dropdown change. so have you set autopostback property of dropdown set to true. if not plz do so.
"You just become, like a flower becomes the fruit. It's all built in within you. Allow it to work out."
-- Shri Mataji Nirmala Devi.........
for more details visit : http://www.sahajayoga.org
Akhilesh Singh
|
|
|
|
|
Hi All
when i place usercontrol in placeholder.... !postback is not working in the usercontrol ....
Please Let me know ...why !postback condition is not working
Event is not firing for the first time
Thanks
Ramkumar
|
|
|
|
|
getramonweb wrote: Event is not firing for the first time
Your question is not clear. Please explain clearly with relevant code snippets.
|
|
|
|
|
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class SampleMenuPage1 : System.Web.UI.Page
{
private const string BASE_PATH = "~/DynamicControlLoading/";
private string LastLoadedControl
{
get
{
return ViewState["LastLoaded"] as string;
}
set
{
ViewState["LastLoaded"] = value;
}
}
private void LoadUserControl()
{
string controlPath = LastLoadedControl;
if (!string.IsNullOrEmpty(controlPath))
{
PlaceHolder1.Controls.Clear();
UserControl uc = (UserControl)LoadControl(controlPath);
PlaceHolder1.Controls.Add(uc);
}
}
protected void Page_Load(object sender, EventArgs e)
{
LoadUserControl();
if (IsPostBack)
{
//Sleeps for 1 Seconds
//A Fake Deley to show the UpdateProgress/ModalPopup
System.Threading.Thread.Sleep(1000);
}
}
protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
{
MenuItem menu = e.Item;
string controlPath = string.Empty;
switch (menu.Text)
{
case "Load Control2":
controlPath = BASE_PATH + "SampleControl2.ascx";
break;
case "Load Control3":
controlPath = BASE_PATH + "SampleControl3.ascx";
break;
default:
controlPath = BASE_PATH + "SampleControl1.ascx";
break;
}
LastLoadedControl = controlPath;
LoadUserControl();
}
}
In SampleControl2.ascx ..Even is not firing for first time(dropdown onchange event)
And !ispostback is not working
Ramkumar
|
|
|
|
|
you need to initiate a postback from the menu click, so you can (if the control allows it) set the AutoPostBack property to 'true', or you can do it through javascript.
|
|
|
|
|
thanks for your reply...May I know in which place I have to set AutoPostBack property to 'true'
Ramkumar
|
|
|
|
|
this would be on the actual control you are clicking on. If it is a dropdown list, combo-box, etc., it would be in the list of properties underneath the solution explorer in the default layout of visual studio.
you might need to register the event handler for some controls however. You can find info on doing that on the MSDN website. Also, you can look for properties such as 'OnClick', 'OnCheckChanged', etc. in the properties box. You might also look for the button at the top of the properties box that looks like a lightning bolt. This switches the properties to events and you can define methods in the code-behind file to handle the associated event.
You should first start by looking for the AutoPostBack property though as this is what tells the ASP.NET page to make a trip back to the server for more processing.
|
|
|
|