The Wayback Machine - https://web.archive.org/web/20090220170806/http://www.codeproject.com:80/script/Forums/View.aspx?fid=12076
Click here to Skip to main content
5,908,898 members and growing! (15,788 online)
Announcements
* Bold indicates new messages since 7:08 20 Feb '09




BullFrog Power
Advanced Search
Sitemap

ASP.NET


Home > Forums > ASP.NET

 Msgs 1 to 25 of 7,915 (Total in Forum: 140,803) (Refresh)FirstPrevNext
AdminHow to get an answer to your questionadminChris Maunder17:29 10 Nov '05  
For those new to message boards please try to follow a few simple rules when posting your question.
  1. Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
  2. 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.
  3. Keep the subject line brief, but descriptive. eg "File Serialization problem"
  4. Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
  5. 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.
  6. Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
  7. Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
  8. Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
  9. If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
  10. No advertising or soliciting.
  11. 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

QuestionConvert from ASP.NET Development to IISmemberjeffwask1 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
QuestionUsercontrol with DropDownList OnselectedIndexChanged event hangsmemberdigimanus3hrs 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?
AnswerRe: Usercontrol with DropDownList OnselectedIndexChanged event hangsmemberGreg Chelstowski2hrs 41mins ago 
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 Wink
GeneralRe: Usercontrol with DropDownList OnselectedIndexChanged event hangsmemberdigimanus2hrs 38mins ago 
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?
GeneralRe: Usercontrol with DropDownList OnselectedIndexChanged event hangsmemberGreg Chelstowski2hrs 33mins ago 
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 Wink
GeneralRe: Usercontrol with DropDownList OnselectedIndexChanged event hangsmemberdigimanus2hrs 29mins ago 
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?
GeneralRe: Usercontrol with DropDownList OnselectedIndexChanged event hangsmemberGreg Chelstowski2hrs 22mins ago 
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
GeneralRe: Usercontrol with DropDownList OnselectedIndexChanged event hangsmemberdigimanus1 hr 2mins ago 
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
GeneralRe: Usercontrol with DropDownList OnselectedIndexChanged event hangsmemberdigimanus2hrs 23mins ago 
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.
QuestionQuiting from master pagememberonyang24hrs 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
AnswerRe: Quiting from master pagememberegainz4hrs 2mins ago 
Hi,

Use Session.Remove("SessionVariable")

and check on master page load, if session is nothing then redirect your
login page
AnswerRe: Quiting from master pagemvpAbhijit Jana1 hr 59mins ago 
onyang2 wrote:
Sessio.abandon() or Session.Clear seem not working

Why? How did you know that they are not working ?

cheers,
Abhijit
CodeProject MVP

GeneralRe: Quiting from master pagememberonyang21 hr 29mins ago 
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.
QuestionInvalid postback or callback argumentmemberegainz4hrs 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" %>
AnswerRe: Invalid postback or callback argumentmemberAmandeep Singh Bhullar4hrs 12mins ago 
egainz wrote:
<![CDATA[<%@ Page EnableEventValidation="true" %>]]>


add

EnableEventValidation="false" in page attribute
AnswerRe: Invalid postback or callback argumentmvpJ4amieC3hrs 49mins ago 
Can I suggest that if you take the advice already given, you make sure you fully understand its implications. There are security considerations here.
QuestionAsynchorous post back problem...membermr_muskurahat4hrs 47mins ago 
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

QuestionAssign byte[] to sqldatasource.insertparameter.memberJacquesDP4hrs 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!

QuestionCreate Dll Of App Code [modified]memberegainz6hrs 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

AnswerRe: Create Dll Of App CodememberVuyiswa Maseko6hrs 1 min ago 
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

AnswerRe: Create Dll Of App Codememberjeffwask55mins ago 
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
Questionfiltering a Datagrid using standard controlsmemberMc--Gann6hrs 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.
AnswerRe: filtering a Datagrid using standard controlsmemberaashish.saalvi6hrs 33mins ago 
please describe your question in detail. what exactly do u need.
GeneralRe: filtering a Datagrid using standard controlsmemberMc--Gann6hrs 13mins ago 
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

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Last Updated 9 Aug 2007
Web12 | 2.2.0037 | Advertise | Privacy
Copyright © CodeProject, 1999-2009
All Rights Reserved. Terms of Use