 |
 | How to get an answer to your question |  | Chris Maunder | 17:29 10 Nov '05 |
|
 |
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- If you are posting source code with your question, place it inside <pre></pre> tags, or click the "Ignore HTML tags in this message" check box.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers, Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
 |
 | Convert from ASP.NET Development to IIS |  | jeffwask | 1 hr 14mins ago |
|
 |
I inherited a project that was configured to run a file based Web Site using the ASP.NET Development Web Server. I want to switch this over to run using IIS. I have been looking through the project options but I cannot find how to go about switching this without creating a whole new project. Am I missing something?
Regards,
Jeff
|
|
|
|
 |
 | Usercontrol with DropDownList OnselectedIndexChanged event hangs |  | digimanus | 3hrs 36mins ago |
|
 |
The topic subject mind sounds familiar to some of you.
My problem An Asp.NET website (3.5) with AJAX has a USER CONTROL. This Control exists of a Label and of a DropDownList.
In my WebPage I consume the control and that works.
In the control I have stated:
public event EventHandler SelectedIndexChanged; protected void Page_Init(Object sender, EventArgs e) { this.SelectedIndexChanged += new EventHandler(DDL_Osic); }
protected void DDL_Osic(Object sender, EventArgs e) { if (this.SelectedIndexChanged != null) this.SelectedIndexChanged(sender, e); }
and in the ASPX of the User Control
<asp:DropDownList runat="server" ID="ddlTBM" CssClass="PromptValue" Width="100%" AutoPostBack="true" OnSelectedIndexChanged="DDL_Osic"/>
In the Webpage it says in the aspx
<uc1:PromptSelecteerTBM ID="PromptTBM" runat="server" OnSelectedIndexChanged="PromptTBM_OSIC" />
In the codebehind of the webpage:
protected void PromptTBM_OSIC(Object sender, EventArgs e) { LaadTBMZones(0); }
And now the problem: What happens that if I change the selection of the DropDownList the event of the usercontrol is fired, it goes to the method in the webpage, than returns to the event/method of the usercontrol and returns to the codebehind of the webpage and then back again...and so on What did I do wrong? How to stop this loop?
|
|
|
|
 |
|
 |
SelectedIndexChanged triggers DDL_Osic, which calls SelectedIndexChanged, which triggers DDL_Osic, and so on... that's your loop.
I really do not understand why you add the handler in Page_Init and in aspx, either...
(i've tried posting a similar message a minute ago but i think it crashed, sorry if it actually had posted it and you're gonna see it twice. Though if it crashes again, i'm not gonna type it again 
|
|
|
|
 |
|
 |
Hey Greg,
I added the handlers to both sides because I saw plenty of examples with this. Well if there is 1 too many, which should be removed?
|
|
|
|
 |
|
 |
Don't worry about that, honestly. Whichever you get rid off makes no difference, it's still gonna trigger. Worry about your handler though and get rid of the part that says:
this.SelectedIndexChanged(sender,e); in your DDL_Osic method, though, and add some proper logic to what the program should do at this point. As in what should happen, when the selection has been changed. If DDL_Osic triggers, means it CAUGHT the event. No need to call it again 
|
|
|
|
 |
|
 |
the point is this:
As soons as the usercontrol ddl has changed it selectedindex the webpage should call a method to fill a Gridview which is outside of the usercontrol but in the page.
So if I remove the this.SelectedIndexChanged(sender,e); How can I fill the gridview autoside the ussercontrol with data?
|
|
|
|
 |
|
 |
This is what i'd do. Forget about the code behind of the UserControl, make that Dropdown public in the usercontrol class and on the main aspx add the handler, (Page_Init, Page_Load):
private void Page_Load() { (yourusercontrol).(YourDropdownInUserControlId).SelectedIndexChanged += new EventHandler(s_SelectedIndexChanged); }
private void s_SelectedIndexChanged(object sender, EventArgs) { //your code to update gridview or whatnot
}
Hope this works for you
|
|
|
|
 |
|
 |
Yeah,
this even works better! This component is used over several pages in the system and only in 1 page it should do OnSelectionChangedIndex event. So the other pages have no interference with this.
COOL and many thanx
|
|
|
|
 |
|
 |
FOUND IT
just remove
//if (this.SelectedIndexChanged != null) // this.SelectedIndexChanged += new EventHandler(this.DDL_Osic); in the page_init in the user control. That was the devil that bit me this afternoon!
thanx for your input.
|
|
|
|
 |
 | Quiting from master page |  | onyang2 | 4hrs 14mins ago |
|
 |
How can I quit completely from master page. End all sessions and go back to login page
Sessio.abandon() or Session.Clear seem not working
|
|
|
|
 |
|
 |
Hi,
Use Session.Remove("SessionVariable")
and check on master page load, if session is nothing then redirect your login page
|
|
|
|
 |
|
 |
onyang2 wrote: Sessio.abandon() or Session.Clear seem not working
Why? How did you know that they are not working ?
cheers, Abhijit CodeProject MVP
|
|
|
|
 |
|
 |
Fine Fine . What I did was to set a logout immagebutton to have a postback Url to be "master page" and at the same time code click event to abandon session. I have noticed that it did not recognize the coded click event but the postback. so it works after removing postback Url, but i think such like confusions Microsoft should address instead of using common sense.
|
|
|
|
 |
 | Invalid postback or callback argument |  | egainz | 4hrs 26mins ago |
|
 |
Hi,
some time i get this error :
Exception: System.ArgumentException: Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %>
|
|
|
|
 |
|
 |
egainz wrote: <![CDATA[<%@ Page EnableEventValidation="true" %>]]>
add
EnableEventValidation="false" in page attribute
|
|
|
|
 |
|
 |
Can I suggest that if you take the advice already given, you make sure you fully understand its implications. There are security considerations here.
|
|
|
|
 |
|
 |
can any one guide me that i have a update panel on page
which contains two drop down list country and city on selected index change i am loading cities .
on local machine and lan it works fine ....
but when i host this application on server and try to change country i takes around 3 minutes to load cities i have tried my best to identify the problem.. but failed does any one have idea how to resolve this problem....?????
umerumerumer
|
|
|
|
 |
 | Assign byte[] to sqldatasource.insertparameter. |  | JacquesDP | 4hrs 50mins ago |
|
 |
Hi,
I have a formview that uses a sqldatasource. In the insert item template of the formview I have a file upload control that the user uses to upload an image to the database.
Then on the click event of the insert button I take the image and push it over to a byte array so that I can insert it into the database.
Then I want to update the insert sqlparameter with the byte array to be saved to the database. The problem that I'm facing is that the column type in the database table is that of image, but when i try to set the sqltype of the insert parameter there is no image option under the TypeCode enum.
I can't insert the image as string nor as object cause it gives me an sqlexcpetion of converting from string to image type. The error is as follow : "Operand type clash: nvarchar is incompatible with image"
Any ideas on how to get this working?
Thanks in advance
No matter how long he who laughs last laughs, he who laughs first has a head start!
|
|
|
|
 |
 | Create Dll Of App Code [modified] |  | egainz | 6hrs 22mins ago |
|
 |
Hi,
I have developed a asp.net project using frame work 2.0, & i add some class files in appcode folder & i want to create dll for appcode only which is having some class files
modified on Friday, February 20, 2009 7:06 AM
|
|
|
|
 |
|
 |
What are you actually asking ?
i want to create dll of appcode only if i publish website it create to all dll
Can you please read this and tell me if it make sense. Before you post , please make sure that what you wrote will be understandable to another person.
Thank you
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za www.ITS.co.za
|
|
|
|
 |
|
 |
If I understand what you are asking... What you would need to do is:
1) Add a class library project to your solution 2) Move your classes from app_code to the class library project 3) Add a reference to the class library to your website 4) Add a reference to the namespace to the web.config so you don't have to add a using to every page
<page> <namespaces> <add namespace="MyDll" />
..it may take some debugging but this will get you most of the way there.
Regards,
Jeff
|
|
|
|
 |
 | filtering a Datagrid using standard controls |  | Mc--Gann | 6hrs 45mins ago |
|
 |
I have a series of dropdownlists outside the datagrid control. I'm looking for a tutorial or a point in the right direction to learning how to filter the datagrid with these controls.
If anyone knows a good place to start let me know, its much appreciated.
|
|
|
|
 |
|
 |
please describe your question in detail. what exactly do u need.
|
|
|
|
 |
|
 |
I'm looking for a way to drilldown i think it is the datagrid.For instance
When the page loads the default dataset with all the info is retrieved. then the user can filter the data using dropdowns. But they can search between parameters eg. id > 34 id <544
|
|
|
|
 |