Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
fankey
Aug 31, 2001

Victor posted:

That's more like it! As long as someone monitors that for malicious and inappropriate content, it could be quite useful. I should do some editing myself.

I think I just beat you to it!

Adbot
ADBOT LOVES YOU

Xenomorph
Jun 13, 2001
Vista prevents access to many things normally allowed in previous Windows versions.

for example, a normal, non Admin user can create keys in HKey Current User in Windows XP, 2000, etc.

when i ran my Visual Basic 2005 app that did this, i got a permission error and the write failed.

i am using Visual Basic 2005 Express Edition.

how can i make it so that when i run the program, it prompts to run in an elevated access mode?

Dromio
Oct 16, 2002
Sleeper

Xenomorph posted:

how can i make it so that when i run the program, it prompts to run in an elevated access mode?

I believe you have to write a manifest file declaring what security permissions your application needs. A quick search turned up this page.

SLOSifl
Aug 10, 2002


Okay, I'm about halfway done with a SQL2005 based versioned file system, and I really want to make it complete. I would like to store MIME type and extract some metadata (author, comments, etc) to store alongside the files.

How do I extract that metadata when it's present? I found one lovely example that uses an old ActiveX control, but I'd rather do it through straight .NET or P/Invoke if possible. I'm having a google problem today, I can't quite find a query that gets me good results.

As far as MIME type, what's the best way to determine that?

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



I'm going to have to ask about this again because I've been stuck on this data binding thing for days.

My data structure:
code:
class MyContainer : INotifyPropertyChanged
{
	ObservableCollection<string> theCollection;
	public Collection<ContentControl> ControlCollection
	{
		get
		{
			Collection<ContentControl> ret = new Collection<ContentControl>();
			foreach (string st in theCollection)
			{
				ContentControl tmp;
				tmp = new Button();
				tmp.Content = st;
				ret.Add(tmp);
			}
			return ret;
		}
		set//never called!
		{
			Collection<ContentControl> incoming = value as Collection<ContentControl>;
			theCollection.Clear();
			foreach (ContentControl cc in incoming)
			{
				theCollection.Add(cc.Content as string);
			}
			PropertyChanged(this, new PropertyChangedEventArgs("MultilineList"));
			PropertyChanged(this, new PropertyChangedEventArgs("ControlCollection"));
		}
	}

	public String MultilineList
	{
		get
		{
			string ret = "";
			foreach (string st in theCollection)
				ret += st + "\n";
			return ret;
		}
	}

	public MyContainer() { theCollection = new ObservableCollection<string>(); }

	public void Add(string st)
	{
		theCollection.Add(st);
		if (PropertyChanged != null)
		{
			PropertyChanged(this, new PropertyChangedEventArgs("MultilineList"));
			PropertyChanged(this, new PropertyChangedEventArgs("ControlCollection"));
		}
	}
	public event PropertyChangedEventHandler PropertyChanged;
}
Setting up the binding in code:
code:
Binding tbBinding = new Binding("ControlCollection");
tbBinding.Source = stringCollection;
tbBinding.Mode = BindingMode.TwoWay;
tbBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
scrollingItems.SetBinding(OrderChangingItemsControl.ItemsSourceProperty, tbBinding);
Changing the ItemsSource order:
code:
private void swapChildren(UIElement A, UIElement B)
{
	int Aindex = base.Items.IndexOf(A);
	int Bindex = base.Items.IndexOf(B);
	((System.Collections.ObjectModel.Collection<ContentControl>)base.ItemsSource)[Aindex] = B as ContentControl;
	((System.Collections.ObjectModel.Collection<ContentControl>)base.ItemsSource)[Bindex] = A as ContentControl;
	//Could also use "Items.SourceCollection" instead of "ItemsSource" but we can't just assign to Items
	//trigger a refresh to make it draw the change
	base.Items.Refresh();
}
That is called from:
code:
protected override void OnPreviewMouseMove(MouseEventArgs e)
{
	base.OnPreviewMouseMove(e);

	// If no element is being dragged, there is nothing to do.
	if (this.ElementBeingDragged == null || !this.isDragInProgress || (e.LeftButton == MouseButtonState.Released))
				return;				//check released state in case the mouse leaves the control and comes back during drag

	// Get the position of the mouse cursor, relative to the Canvas.
	Point cursorLocation = e.GetPosition(this);

	UIElement invadee = this.cursorOverNeighbor(cursorLocation);
	if (invadee != null)
	{
		//move the button by swapping it with its neighbor
		this.swapChildren(invadee, this.ElementBeingDragged);
		//set a new origin location so we can compute the drag direction correctly if the user moves it abck the other way
		this.origCursorLocation = e.GetPosition(this);
	}

	e.Handled = true;//need this to keep the buttons from getting clicked during drag
}
That method is in:
code:
class OrderChangingItemsControl : ItemsControl
I know it probably looks ugly but this is mostly a demonstration and will be changed signifigantly later on. Thing is, for it to work corretly, I need the bidirectional binding to work. The set method of the ControlCollection is never called so I know the problem is somewhere before that in the chain of events. I think I have my binding and data structure set up correctly, but every bidirectional example I can find involves a loving TextBox and that doesn't seem do me all that much good.
Stuck in a Binding problem please send ha;p :(

csammis
Aug 26, 2003

Mental Institution

Munkeymon posted:

The set method of the ControlCollection is never called so I know the problem is somewhere before that in the chain of events.


Okay, you're right about what's happening, now here's why: When you access elements of the exposed collection (ANY collection exposed by a property, by the way), you're not changing the property. You're only getting the reference to the collection and then working with it. The set is only called when you do assignation at the collection level; that is, when you change the reference itself. You'll have to call PropertyUpdated() manually to trigger the binding after you swap the collection's elements.

genki
Nov 12, 2003
Well, if you have Observable collection in there, I believe you must be using WPF.

I'm not entirely clear how that code is supposed to work.

All the binding I've done is based on lists of objects. Using a BindingSource has worked very well for me.

Otherwise, I'd suggest going through Bea Costa's blog posts and looking for something relevant.
This is a link to her most recent post. The content is still online, but for some reason the base domain no longer displays articles.
http://www.beacosta.com/Archive/2006_11_01_bcosta_archive.html

Also, have you looked around the MSDN WPF forum?
http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=119&SiteID=1

edit:

csammis posted:

Okay, you're right about what's happening, now here's why: When you access elements of the exposed collection (ANY collection exposed by a property, by the way), you're not changing the property. You're only getting the reference to the collection and then working with it. The set is only called when you do assignation at the collection level; that is, when you change the reference itself. You'll have to call PropertyUpdated() manually to trigger the binding after you swap the collection's elements.
Oh, that's what he's doing! :haw:

csammis
Aug 26, 2003

Mental Institution

genki posted:

Oh, that's what he's doing! :haw:

Once all the code was there I realized what was happening, because I had the exact same problem with one of the earlier versions of the shaim contact list, which at the time was a very messed-up TreeView...swapping items was not the most fun thing ever for this exact reason :) One of the basic WPF observable collections allows you to swap elements with a member function (so that the binding automatically happens correctly), although I forget which one. I think it's TreeView's ItemCollection, but I can't look it up right now because I'm at work.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



csammis posted:

Okay, you're right about what's happening, now here's why: When you access elements of the exposed collection (ANY collection exposed by a property, by the way), you're not changing the property. You're only getting the reference to the collection and then working with it. The set is only called when you do assignation at the collection level; that is, when you change the reference itself. You'll have to call PropertyUpdated() manually to trigger the binding after you swap the collection's elements.

There is no PropertyUpdated method anywhere the reflector can find :confused:

Do you mean the PropertyChanged event? I tried adding the INotifyPropertyChanged interface to my custom control but PropertyChanged never got called or even hooked into.

genki posted:

Also, have you looked around the MSDN WPF forum?

Is that the right place for this sort of thing? I was looking around but wasn't shure if this was a C# problem or a WPF problem.

Munkeymon fucked around with this message at 20:47 on Jan 26, 2007

csammis
Aug 26, 2003

Mental Institution

Munkeymon posted:

There is no PropertyUpdated method anywhere the reflector can find :confused:

Do you mean the PropertyChanged event?

Yeah so I can't read, whatever it's cool :colbert:

quote:

I tried adding the INotifyPropertyChanged interface to my custom control but PropertyChanged never got called or even hooked into.

You're calling PropertyChanged at least four times in MyContainer. Is the binding not responding when you add an item too? I thought you were only having problems with the swap.

Munkeymon posted:

Is that the right place for this sort of thing? I was looking around but wasn't shure if this was a C# problem or a WPF problem.

It's WPF. Bindings don't have anything to do with C# in particular.

genki
Nov 12, 2003

csammis posted:

It's WPF. Bindings don't have anything to do with C# in particular.
Well, they do, but if you're using ObservableCollection, it's WPF-specific. Even if that's not the issue you're having, it's probably the easiest place to find a bunch of people trying to do the same thing you are.

edit: vvvv ah, gotcha.

genki fucked around with this message at 20:58 on Jan 26, 2007

csammis
Aug 26, 2003

Mental Institution

genki posted:

Well, they do, but if you're using ObservableCollection, it's WPF-specific. Even if that's not the issue you're having, it's probably the easiest place to find a bunch of people trying to do the same thing you are.

What I meant was that the Bindings are not specific to C#, as you can (obviously) use them in any .NET language. Even if it wasn't a WPF application, he'd want to go someplace that was specifically using the technology in question.

Xenomorph
Jun 13, 2001

Dromio posted:

I believe you have to write a manifest file declaring what security permissions your application needs. A quick search turned up this page.

thank you for the help. i've tried using Manifests, but when i do, instead of running the program, i get an error dialog (red circle w/ white 'x' in it), and Even Viewer tells me this line:

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">

has an incorrect version number.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



csammis posted:

You're calling PropertyChanged at least four times in MyContainer. Is the binding not responding when you add an item too? I thought you were only having problems with the swap.

Oh, you meant call it in the container. I thought you meant call it in the Panel just after I swap the items.

Do I need to pass out an ObserveableCollection and watch for changes in it to call MyContainer's PropertyChanged()? I don't see how the container would know the change took place otherwise.

csammis
Aug 26, 2003

Mental Institution

Munkeymon posted:

Do I need to pass out an ObserveableCollection and watch for changes in it to call MyContainer's PropertyChanged()? I don't see how the container would know the change took place otherwise.

Well that's the entire problem :v:

Since you're implementing the collection, you have complete control over it. What you should be doing is making the swap method a member of the collection, then call PropertyChanged (similar to what you have for Add right now). That way the operation that changes the collection is logically connected to the collection itself. If that won't fly for whatever reason, what you can do us expose a public method that triggers the PropertyChanged event, and call that after you fiddle with the collection's elements.

code:
class MyContainer
{
  ..
  public void RaisePropertyChanged(string propname)
  {
     if(PropertyChanged != null)
     {
       PropertyChanged(this, new PropertyChangedEventArgs(propname));
     }
  }
}

fankey
Aug 31, 2001

I'm still learning about ObservableCollections but wouldn't it be more correct to also derive your collection from INotifyCollectionChanged? You could also hook your contained collection change events to call your class level ones -

code:
public event NotifyCollectionChangedEventHandler CollectionChanged;

MyContainer()
{
  .....
  //propagate the CollectionChanged event  
  theCollection.CollectionChanged += 
    delegate(object sender, NotifyCollectionChangedEventArgs e)
    {
      OnCollectionChanged(e);
    };
}

protected OnCollectionChanged(NotifyCollectionChangedEventArgs e) 
{
  if( CollectionChanged != null )
  {
    CollectionChanged(this,e);
  }
}

fankey fucked around with this message at 22:08 on Jan 26, 2007

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



I didn't know about INotifyCollectionChanged and I just assumed that INotifyPropertyChanged treated all properties the same. Now that I re-read the INPC documentation, it makes more sense because it wants the objects coming from the source to have events handled for each individual property they have and I didn't do that.

See, csammis, I'm trying to avoid marrying the control to my test data structure, which seems to be at odds with putting the manipulation logic in the data structure.

Next I probably get to figure out how to do scrolling and dragging at the same time. My first week woring with WPF has been rather stressfull so far :f5: I have never, even while I was taking my compilers course, dreamed about code before. I don't know if thats a good thing or not :\

Thanks for your help guys.

Edit: forgot to say thanks :(

Munkeymon fucked around with this message at 05:21 on Jan 27, 2007

DLCinferno
Feb 22, 2003

Happy

SLOSifl posted:

Okay, I'm about halfway done with a SQL2005 based versioned file system, and I really want to make it complete. I would like to store MIME type and extract some metadata (author, comments, etc) to store alongside the files.

How do I extract that metadata when it's present? I found one lovely example that uses an old ActiveX control, but I'd rather do it through straight .NET or P/Invoke if possible. I'm having a google problem today, I can't quite find a query that gets me good results.

As far as MIME type, what's the best way to determine that?

Here's the p/invoke for mime type:

http://www.pinvoke.net/default.aspx/urlmon/FindMimeFromData.html


As far as the metadata goes, you might be referring to this dll:

http://support.microsoft.com/kb/224351

...which basically lets you pull properties from compound OLE documents very easily. If you find this lovely for some reason, there's a number of approaches you can take to reading compound documents, but none of them are particularly easy. Managing structured storage files is alot more complex then it really should be, at least for me.

genki
Nov 12, 2003

Munkeymon posted:

See, csammis, I'm trying to avoid marrying the control to my test data structure, which seems to be at odds with putting the manipulation logic in the data structure.
HAHAHAHAHAHA!

You'll go insane trying to do it. Trust me. I still am. Going insane.

Currently, I'm basically using intermediate wrappers.

ObservableCollection really doesn't do what you'd want it to do, i.e. a collection you can use for data. It's in the user interface libraries and basically seems to be designed specifically to be married to a control.

If you have any particular success in a data structure that's independent of UI libraries that still interacts with UI elements effectively, please let me know! :v:

Nurbs
Aug 31, 2001

Three fries short of a happy meal...Whacko!
Has anyone ever encountered the error "conversion failed when converting string to uniqueidentifier" ?

I'm using System.GUID.NewGUID().ToString(); to create new IDs to enter into my database. I've done this successfully at other points in the code. For some reason one particular function is having this problem when it tries to run the ExecuteNonQuery method

code is C#
code:
string insertStatement = "", ID = "", name = "";

SqlCommand sqlCommand = new SqlCommand(insertStatement,databaseConnection);

ID = System.GUID.NewGUID().ToString();
name = "Bob" //(parameter passed into function)

insertStatement = "INSERT INTO tableX (ID,name) VALUES ('" +
                   ID + "', '" +
                   name + "');

sqlCommand.CommandText = insertStatement;
sqlCommand.ExecuteNonQuery(); // Throws exception

havelock
Jan 20, 2004

IGNORE ME
Soiled Meat

Nurbs posted:

Has anyone ever encountered the error "conversion failed when converting string to uniqueidentifier" ?

I'm using System.GUID.NewGUID().ToString(); to create new IDs to enter into my database. I've done this successfully at other points in the code. For some reason one particular function is having this problem when it tries to run the ExecuteNonQuery method

code is C#
code:
string insertStatement = "", ID = "", name = "";

SqlCommand sqlCommand = new SqlCommand(insertStatement,databaseConnection);

ID = System.GUID.NewGUID().ToString();
name = "Bob" //(parameter passed into function)

insertStatement = "INSERT INTO tableX (ID,name) VALUES ('" +
                   ID + "', '" +
                   name + "');

sqlCommand.CommandText = insertStatement;
sqlCommand.ExecuteNonQuery(); // Throws exception



Please never ever do this. Use parameterized sql instead.
code:
using(SqlConnection conn = new SqlConnection(connstr))
{
  using(SqlCommand cmd = new SqlCommand("INSERT INTO tableX (ID,name) VALUES (@id, @name)"))
  {
    cmd.Parameters.AddWithValue("@id", System.Guid.NewGuid());
    cmd.Parameters.AddWithValue("@name", "bob");
    conn.Open();
    cmd.ExecuteNonQuery();
  }
}

Essential
Aug 14, 2003
Simple question that may have a complicated answer:

I'm new to asp.net and right now I'm learning about passing data between forms. So, one method was to use a hyperlink and set the postbackurl property to the form to change to, then add a querystring to the end of that and pass over your data.

Another method involved setting the Request.Form("key") object in the page_load event of the form to postback to, then in the form to post from, you would add a button with the postbackurl equal to the form to postback to. The trick here is to name the key in the postback form to the name of the textbox that the value is coming from: Request.Form("txtFirstName")

Another method is using the Profile class and passing data off there and then just grabbing it as needed.

Another one I just tried and also could not get working is using the PreviousPage object to see if the page loaded from another page (I think), then using PreviousPage.FindControl to find the control in question and then grabbing the data from the control. I couldn't get this to work because PreviousPage.Findcontrol was returning nothing.

The last method which I haven't done yet would be to store in a db and then grab it, but I'm guessing for a lot of data that is just overkill and would take to long for what the purpose is anyway (I'm thinking like if you enter billing info, then it posts to another page to verify your info).

So in doing all these tutorials and reading through my new book, ASP.NET 2.0 Unleasehed, I'm getting bombarded with different ways to do this stuff and I'm wondering what you guys typically use?

Essential fucked around with this message at 05:57 on Jan 29, 2007

wwb
Aug 17, 2004

Depends on the scenario, but when one needs to have a multi-part form, I typically don't actually pass data between forms so much as use multiple forms on one page and let asp.net manage information using viewstate. The wizard control greatly simplifies this process from the days of 1.x, especially as form states multiply. Main drawback is that viewstate can get monstorous at times.

If you are talking about persisting data across a user's visit, or session, well, that is what the Session is for.

I would not use Profile for temporary storage, the space is too expensive for that sort of use.

Essential
Aug 14, 2003

wwb posted:

I typically don't actually pass data between forms so much as use multiple forms on one page and let asp.net manage information using viewstate.

Hmm, ok well that is something I haven't seen yet.


wwb posted:

If you are talking about persisting data across a user's visit, or session, well, that is what the Session is for.

So would you typically set up your session objects in the Global.asax file?


wwb posted:

I would not use Profile for temporary storage, the space is too expensive for that sort of use.

Yes, that is what I was thinking, it was just another example. Profile seems great though for, well uh, user profile data :)

poopiehead
Oct 6, 2004

Essential posted:

So would you typically set up your session objects in the Global.asax file?

No need. Just do:
Session["asdadad"] = anyobject;
in any page.

If you end up keeping things all in the same page, then Viewstate is better as long as you're not trying to save huge things.

I generally use Viewstate and a bunch of panels based on what I want to display in these kinds of cases, though the WizardView is probably better. I just never used it before.

Essential
Aug 14, 2003

poopiehead posted:

I generally use Viewstate and a bunch of panels based on what I want to display in these kinds of cases, though the WizardView is probably better. I just never used it before.

I want to see if I get this right. You might have, say a home page panel, a products page panel and a contact us panel and just load/show whatever panel based on where the user wants to go? And all these panels are on one page? If that's the case does this make for a faster site?


Also, if someone can just help me out a bit: I have an interview tomorrow for a junior asp.net developer position. One requirement is experience with Authentication and Authorization mechanisms. I have used the login controls, set up user roles, uh that thing where you allow/dissallow roles to certain areas and have read about using Windows auth, Forms auth, or .net passport auth. Can anyone add anything that may help me out with explaining a bit about this?

The other thing they want is in depth knowledge of asp.net 2.0 page lifecycle. Are they refereing to "state" issues or page_init, page_load type stuff? Any ideas?


One last thing, when I add a button to a form, it stretches way the gently caress across the page. I've even loaded up a new, fresh project and it's doing the same thing. Any ideas on this one?

Essential fucked around with this message at 06:53 on Jan 29, 2007

poopiehead
Oct 6, 2004

Essential posted:

I want to see if I get this right. You might have, say a home page panel, a products page panel and a contact us panel and just load/show whatever panel based on where the user wants to go? And all these panels are on one page? If that's the case does this make for a faster site?

Not exactly. Home and products would be separate pages. My products page would most likely accept a product ID in the query string from a normal link on another page. If I was using something other than a link, like a select box to get to the product page, then I would use Response.Redirect() to get to the product page.

I'm having trouble coming up with a good example for a single page that could be multiple page...... Let's assume you have a mortgage calculator. The first page is a form to fill out your financial stuff and the second is to display some graphs or something of ways to pay off your mortgage or whatever. Assume the form is really long, so it wouldn't look good if you just put the forms and graphs on the same page. I'll probably have two panels. One for the form and one for the graphs. Initially, the graphs are not visible and the form is visible. On postback, I do processing and then toggle the visibility of each panel so that only the graphs are showing.


quote:

The other thing they want is in depth knowledge of asp.net 2.0 page lifecycle. Are they refereing to "state" issues or page_init, page_load type stuff? Any ideas?

They most likelye mean page_init, page_load etc. They also might be interested in if you know the order in which child controls get their events fired(wrt to parents) or how master pages fit into the picture.

Essential
Aug 14, 2003

poopiehead posted:

I'm having trouble coming up with a good example for a single page that could be multiple page...... Let's assume you have a mortgage calculator. The first page is a form to fill out your financial stuff and the second is to display some graphs or something of ways to pay off your mortgage or whatever. Assume the form is really long, so it wouldn't look good if you just put the forms and graphs on the same page. I'll probably have two panels. One for the form and one for the graphs. Initially, the graphs are not visible and the form is visible. On postback, I do processing and then toggle the visibility of each panel so that only the graphs are showing.

Ok that makes sense.


poopiehead posted:

They most likelye mean page_init, page_load etc. They also might be interested in if you know the order in which child controls get their events fired(wrt to parents) or how master pages fit into the picture.

Well I might be hosed then. I haven't paid much attention to the page_init, page_load stuff accept looking at a trace log, where it's obviously easy to see what order the events fire in.

Referring to master pages though, you mean how a master page is used to set up a consistent default look, with respect to header, footer and menu navigation (as well as anything else you want to set up). Then you add content pages that use the master page as the parent page and add your page specific interface into the ContentControl? (I think it's called ContentControl)

poopiehead
Oct 6, 2004

Essential posted:

Referring to master pages though, you mean how a master page is used to set up a consistent default look, with respect to header, footer and menu navigation (as well as anything else you want to set up). Then you add content pages that use the master page as the parent page and add your page specific interface into the ContentControl? (I think it's called ContentControl)

Exactly, but I meant the order in which events fire on the master page. Like does the load of the master page or the page get called first. And then also do the load events of child controls get called before or after their parents' loads. I'm not sure of the answer without looking it up but figured that may be a question they'd ask when they specifically mentioned they want you to already know the page lifecyle.

Essential
Aug 14, 2003

poopiehead posted:

Exactly, but I meant the order in which events fire on the master page. Like does the load of the master page or the page get called first. And then also do the load events of child controls get called before or after their parents' loads. I'm not sure of the answer without looking it up but figured that may be a question they'd ask when they specifically mentioned they want you to already know the page lifecyle.

Awesome poopiehead, thanks so much for your help. I'll try to crash course what you mentioned above tonight so I'll at least have a halfway decent answer for them if they ask that. If not then I'm just that much farther ahead then before.

Page Lifecylce: Pre_Init, Init, Init_Complete, Pre_Load, Load, Load_Complete, PreRender, PreRenderComplete, SaveStateComplete, Render.

Essential fucked around with this message at 08:17 on Jan 29, 2007

wwb
Aug 17, 2004

Great answers from Poopiehead. Here are a few comments/additions:

1) For ASP.NET 2.0, you really should use the wizard or the Multi-View rather than a bunch of panels. It is much cleaner. No need to get hung up on this though.

2) On storing session--or any other object collection-backed variable, I almost always wrap it in a property at an appropriate level so that I am never dealing directly with the Session's object collection outside the method. For a web app, I would suggest using a base page class to handle this. The advantages here are that first, you can more easily change the storage medium for this varaible based on canging requirements because everything is talking to this property. Second, you are not casting the variable everyhere. And finally, you are not using a string literal in your code, nor dependant on spelling said string literal correctly everywhere.

3) Go see the best drawing ever on page lifecycle.

Essential
Aug 14, 2003

Thanks wwb, that really is a great lifecycle diagram and shows a much more complete view then the page I found earlier.

Victor
Jun 18, 2004
Essential, read TRULY Understanding ViewState.

Fiend
Dec 2, 2001
TIP: Are we allowed to provide answers to questions that we haven't been asked? If you find your self spending a lot of time manually collapsing outlines in code view when you could use a button to do that for you.

quote:

Right click on a blank area on the menu bar and click Customize.
Select Edit from the Categories list, then scroll down in the Commands list to Outline Collapse To Definitions.
Drag and drop that on your menu and customize as you see fit.

EDIT: Added TIP prefix for hawt hawt (albeit nonexistant) aggregate action.

Fiend fucked around with this message at 20:02 on Jan 29, 2007

Victor
Jun 18, 2004

Fiend posted:

Are we allowed to provide answers to questions that we haven't been asked?
These are considered tips and are very welcome as far as I'm concerned. Just a thought: if they're preceded by Tip: or something like that, a script could be written to aggregate them.

poopiehead
Oct 6, 2004

Victor posted:

These are considered tips and are very welcome as far as I'm concerned. Just a thought: if they're preceded by Tip: or something like that, a script could be written to aggregate them.

Or even better, put them inside [tip][/tip] tags. That way a script would only grab the tips and not the rest of the post, like Fiend's edit.

Essential
Aug 14, 2003

Victor posted:

Essential, read TRULY Understanding ViewState.

Thanks for the link Victor, I'm going to check that out shortly and I'm sure it will be really helpful. Unfortunatly I didn't get a chance to view this before my interview, but fortunatly he did not ask me anything about view state. The interview went really well so I should know in the next day or two.

Thanks fellahs for all your help.

Yaksha
Jun 28, 2005

Demilich
Not really a .NET question but I was hoping you guys could help me out. I've been tasked with a pretty big project, beyond my knowledge. I think the best way to complete the project will be to have an ASP.NET application. Does anyone have any suggestions on where I should look to find a developer and about how much per hours I should be expected to be charged?

DarkPaladin
Feb 11, 2004
Death is just God's way of telling you you wasted your life.
^^^^^^^^^^^^^I think there is a stickied thread of Goon Freelancers, they'd be the people to go to for the job. As far as hourly, you're probably looking at between $40-$100 an hour depending on the length of the job and complexity of the work. Also how experienced your programmer is.

Edit: My appologies it is no longer stickied. Just put out a thread with the basic project spec's and have someone from here contact you with a quote.

-----------New Question-------------

I'm putting together an international registration page for the company I work for. Right now I want to have a country drop down and a reigon drop down. The region drop down will update based on what country is selected. Simple right? Here's my problem, I'm pulling the values of both out of the database and I'm trying to somehow do it without a full postback of the page.

On MS's adcenter website's registration they have something that seems like what I'm looking for. The basic idea is that the field below seems to update client side and the rest of the page isn't posted back. Any ideas on how this is done? It seems like it's just too much information for client side javascript.

DarkPaladin fucked around with this message at 23:01 on Jan 30, 2007

Adbot
ADBOT LOVES YOU

JediGandalf
Sep 3, 2004

I have just the top prospect YOU are looking for. Whaddya say, boss? What will it take for ME to get YOU to give up your outfielders?
I think I might have convinced the programming department @ school to use C#/.NET. Go me! However, they don't know a lick of C#, but they were very impressed with what they saw. I did a side-by-side comparison of the same program written in MFC and in C#. They liked how C# looked less menacing than MFC and easier to maintain.

If they choose my C# version (oh please oh please), what materials do you all recommend for them? They are all basically C++ people. One has some Java experience.

  • Locked thread