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
uXs
May 3, 2005

Mark it zero!

salithus posted:

The DataGridView is working now. I realized I hadn't rebooted since last week :v:

Thanks for the pointers though. Is there a cleaner approach to what I'm doing though? I've got a listbox of products, and when I select a product, I want it to populate the datagrid. When the app loads, it's populating the product list and starts with the first one selected, so it should have that product line's data populated, but forcing the "SelectedIndexChanged" event seems too forceful.

You may be able to do it by doing the binding with master-detail databinding and using one bindingsource as the source for the other or something like that, instead of handling that in code.

Or put the code to fill the grid in a seperate function and call it when the form loads. You're still loading it manually one time when the app starts, but it feels less icky to me than calling the event handler or setting the selected index in code.

Adbot
ADBOT LOVES YOU

csammis
Aug 26, 2003

Mental Institution

salithus posted:

When the app loads, it's populating the product list and starts with the first one selected, so it should have that product line's data populated, but forcing the "SelectedIndexChanged" event seems too forceful.

That's sort of the issue though, isn't it? The list is starting with the index at 0, it's not changing. Is there an event you can attach to that indicates when the DataSource has changed, so that you could fire the logic in that method?

Kekekela
Oct 28, 2004
code:
cbxProductList.SelectedIndex = 1; //So SelectedIndexChanged will fire...
cbxProductList.SelectedIndex = 0;

quote:

Is there a cleaner approach to what I'm doing though? ... but forcing the "SelectedIndexChanged" event seems too forceful.

If you're just trying to get the code you've placed in cbxProductList_SelectedIndexChanged to fire without calling it directly, then just move that code out to its own method. Call your new method from within cbxProductList_SelectedIndexChanged and also in place of the code snippet above. This seems overly simple though so maybe I'm just not understanding the question.

csammis
Aug 26, 2003

Mental Institution

Kekekela posted:

If you're just trying to get the code you've placed in cbxProductList_SelectedIndexChanged to fire without calling it directly, then just move that code out to its own method. Call your new method from within cbxProductList_SelectedIndexChanged and also in place of the code snippet above. This seems overly simple though so maybe I'm just not understanding the question.
That's the exact same process as calling the event handler directly :confused:

Kekekela
Oct 28, 2004

csammis posted:

That's the exact same process as calling the event handler directly :confused:

If this is what you have:
cbxProductList_SelectedIndexChanged(...)
{code to run}

and you change to:
cbxProductList_SelectedIndexChanged(...)
{foo();}

foo()
{code to run}

Then you can just call foo() instead of cbxProductList_SelectedIndexChanged(...).

I think I'm probably not understanding your problem, it seems like you're just saying you want to fire the code you currently have in cbxProductList_SelectedIndexChanged without calling it directly.

edit - csammis: Just realized you weren't the person posting the problem. Please mentally change this from 2nd person to 3rd person when you read it.

Kekekela fucked around with this message at 01:46 on Jul 11, 2007

csammis
Aug 26, 2003

Mental Institution

Kekekela posted:

If this is what you have:
cbxProductList_SelectedIndexChanged(...)
{code to run}

and you change to:
cbxProductList_SelectedIndexChanged(...)
{foo();}

foo()
{code to run}

Then you can just call foo() instead of cbxProductList_SelectedIndexChanged(...).

I know what you meant, and again, it's the exact same thing as calling it directly but with the added bonus of an additional stack frame every time the event handler is called for real :psyduck:

Kekekela posted:

edit - csammis: Just realized you weren't the person posting the problem. Please mentally change this from 2nd person to 3rd person when you read it.

I just figured you meant "you" as in "you in general" :)

csammis fucked around with this message at 01:52 on Jul 11, 2007

Inquisitus
Aug 4, 2006

I have a large barge with a radio antenna on it.

csammis posted:

I know what you meant, and again, it's the exact same thing as calling it directly but with the added bonus of an additional stack frame every time the event handler is called for real :psyduck:
It also means you don't have to gently caress around with EventArgs and senders when they're not at all relevant :)

Kekekela
Oct 28, 2004

csammis posted:

I know what you meant, and again, it's the exact same thing as calling it directly but with the added bonus of an additional stack frame every time the event handler is called for real :psyduck:

Yes, its the same thing and I'm not saying its right or wrong, just trying to answer his question. That said, there are certainly reasons to move your code out of the method the event handler is calling, especially if you are using the graphical IDE to develop the interface and letting it auto-generate the event handler and method for you.

If its code that you can reuse it probably makes more sense in your design to have it somewhere else. For me, wherever it makes sense to have the code from a design perspective would be where it ends up going. The performance implications of an extra zero parameter stack frame, with no net increase in local variables on the stack, wouldn't be a factor.

Kekekela fucked around with this message at 02:21 on Jul 11, 2007

salithus
Nov 18, 2005
I'm at home now, so I can't try it 'til the AM, but I'm hoping that SelectedValueChanged will be the winner.

For those keeping score at home, I'm ideally looking for something that will fire when the list gets populated and when the user selects a new value without me explicitly calling a function.

csammis
Aug 26, 2003

Mental Institution

salithus posted:

For those keeping score at home, I'm ideally looking for something that will fire when the list gets populated and when the user selects a new value without me explicitly calling a function.

Like I suggested, you're probably going to be looking for a method to fire when the data context changes as well as the SelectedIndexChanged event. Try DataSourceChanged or BindingContextChanged.

salithus
Nov 18, 2005

csammis posted:

Like I suggested, you're probably going to be looking for a method to fire when the data context changes as well as the SelectedIndexChanged event. Try DataSourceChanged or BindingContextChanged.

I guess I didn't word that very well. What I was looking for is something that would populate my ListBox whenever a new value was selected. I thought that giving it the ListBox a DataSourcewould leave the SelectedIndex at -1 and that by setting SelectedIndex to 0, I would be setting the default selection and firing an event for "hay, i've got something new" by using the SelectedIndexChanged event. It turns out I was incorrect and SelectedIndex was already 0, so setting it to 0 didn't change anything, and my ListBox wasn't being populated with the new initial value.

Now, however, I'm using SelectedValueChanged and it's working like a charm (I needed it to handle both the data changing and the index changing, and it does). Thanks guys! I'm sure I'll have more questions later today.

salithus
Nov 18, 2005
Two new questions:

1) Is there a better way to bind the enabled value of a combobox to the checked value of a check box besides:
code:
private void chkProduct_CheckedChanged(object sender, EventArgs e)
{
    cbxProductList.Enabled = chkProduct.Checked;
}
2) I've got three criteria: product, date, equipment. Each time one of these changes, then I need to update a DataGridView. Is it better to write a function and call it from each change event, or to specify each of the change events directly as the function?

SLOSifl
Aug 10, 2002


salithus posted:

1) Is there a better way to bind the enabled value of a combobox to the checked value of a check box besides:
code:
private void chkProduct_CheckedChanged(object sender, EventArgs e)
{
    cbxProductList.Enabled = chkProduct.Checked;
}
Nope, that's how you do it. It's not like there's any performance issues there, why isn't that good enough?

quote:

2) I've got three criteria: product, date, equipment. Each time one of these changes, then I need to update a DataGridView. Is it better to write a function and call it from each change event, or to specify each of the change events directly as the function?
That depends entirely on how you want to write it. Do whatever makes the most sense to you. If you don't like it, change it later.

Ethangar
Oct 8, 2002

It is time for me to go balls deep into WPF (I've been putting it off for a while now). So I have a few questions:

1.) Visual Studio 2005 with the extensions for .NET 3.0 seems a bit glitchy when dealing with XAML. Everything compiles fine, but the editor is shakey. Will the Orcas beta be much better here?
2.) You that are trying Orcas: is it working pretty well side-by-side with VS2005? I assume it does, since traditionally all the Visual Studios have never given me any problems working side by side.

salithus
Nov 18, 2005

SLOSifl posted:

Nope, that's how you do it. It's not like there's any performance issues there, why isn't that good enough?
That depends entirely on how you want to write it. Do whatever makes the most sense to you. If you don't like it, change it later.

I'm looking for elegance and making sure that I use the tools I have to get the job done instead of making new tools. No sense in rewriting everything that's already there.


Also, I found a better way to do #2. I'm using an intermediate BindingSource and applying .Filter on it. Whee!

fankey
Aug 31, 2001

Ethangar posted:

1.) Visual Studio 2005 with the extensions for .NET 3.0 seems a bit glitchy when dealing with XAML. Everything compiles fine, but the editor is shakey. Will the Orcas beta be much better here?
Yes, but it still have a lot to be desired. I still find myself editing most XAML by hand. I wish there was a way to permamently turn off the visual editor since it just slows things down.

Ethangar posted:

2.) You that are trying Orcas: is it working pretty well side-by-side with VS2005? I assume it does, since traditionally all the Visual Studios have never given me any problems working side by side.
No problems yet. The release notes mention possible problems when uninstalling Orcas. I haven't uninstalled yet but from what I gather you might have to repair your 2005 install after removing Orcas.

I'm not aware of anything in WPF requiring that you move to Orcas except for the slightly better editor. Of course you do get all the new things that come with 3.5. It's a little depressing I'm that excited about a native implementation of HashSet...

Ethangar
Oct 8, 2002

Ah, fankey, you're becoming my go-to guy for WPF questions :) Thanks again.

Munkeymon
Aug 14, 2003

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



csammis posted:

an additional stack frame every time the event handler is called for real :psyduck:

Do you (or anyone else reading this) have any idea what the normal overhead is for a stack frame in .Net? This question intrests me greatly because our lead developer has chosen to use the MVP model for our UI development and it tends to result in a far larger number of method calls than we really need.

I can't find anything good on Google, but I have a hard time finding anything out about general .Net stuff most of the time since there's so much chaff out there in the form of 'SomeBodyWhoThinksHesSooClever at someshittysite dot net' and also every website in the .net domain. Also, does anyone else wish google would mark RSS feeds or seperate them out of regular search results in some way?

csammis
Aug 26, 2003

Mental Institution

Munkeymon posted:

Do you (or anyone else reading this) have any idea what the normal overhead is for a stack frame in .Net? This question intrests me greatly because our lead developer has chosen to use the MVP model for our UI development and it tends to result in a far larger number of method calls than we really need.

Size-wise I don't think it's particularly huge - it's definitely relative to number of local variables, of course. A single call doesn't necessarily take a lot of time to jump either (but repeated calls do, that's why performance can improve with inlining)...but personally I just hate enormous call chains. I'm mad about stack traces I get that end with "56 more" (thanks Eclipse! :v: )

quote:

Also, does anyone else wish google would mark RSS feeds or seperate them out of regular search results in some way?

That would be nice indeed.

Munkeymon
Aug 14, 2003

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



csammis posted:

Size-wise I don't think it's particularly huge - it's definitely relative to number of local variables, of course. A single call doesn't necessarily take a lot of time to jump either (but repeated calls do, that's why performance can improve with inlining)...but personally I just hate enormous call chains. I'm mad about stack traces I get that end with "56 more" (thanks Eclipse! :v: )

See, with MVP, you need ~3 calls to do any one thing on any one layer of your UI, so if you have something like a form holding tabs which hold forms wich hold controls, then talking to that grandchild control is a 12 step process (as opposed to 4). Even where it's something relatively simple like telling a browser to go back. This concerns me because I cant seem to help but worry about ostensibly stupid poo poo like the ammount of memory wasted by stack frame headers (not to mention that debugging things turns into a huge headache). These probably arent inlineable calls, either, since each of the three layers of each control lives in a seperate namespace with its own assembly and most of the calls are made to interface methods. Interfaces live in their own namespace, too.

casseopei
Jun 21, 2006
This is a really stupid question but it's one that no amount of googling or poking around has seemed to yield a result. Maybe I'm just doing something wrong.

I have an XML file. In this file, let's say I have..

<boobs>d</boobs>
<boobs>c</boobs>
<boobs></boobs>

I'd like to know if the node is empty or not when I read it with XmlTextReader. So when it hits the last boobs, I want to be able to do..

if (the node is empty)
{
do this
}

Nothing I've been able to find seems to tell me how to do that. .IsEmptyElement is for <boobs/>, which isn't what I'm working with. I thought maybe it was returning null, or String.Empty, or something but none of that seems to work.

Anyone happen to know?

Edit: This is in C# .net.

casseopei fucked around with this message at 21:25 on Jul 11, 2007

csammis
Aug 26, 2003

Mental Institution

casseopei posted:

I'd like to know if the node is empty or not when I read it with XmlTextReader.

Try

code:
if(String.IsNullOrEmpty(node.InnerText))
{
  // Do something
}

pliable
Sep 26, 2003

this is what u get for "180 x 180 avatars"

this is what u fucking get u bithc
Fun Shoe

genki posted:

It's not an elegant solution, but based on what you need, this might be the only way...

Doesn't seem to work. It seems that Explorer wants to keep a permanent lock for some reason on the file, so it's constantly throwing exceptions.

This is depressing :(. Regardless, thanks for the help so far guys, I appreciate it.

casseopei
Jun 21, 2006

csammis posted:

Try

code:
if(String.IsNullOrEmpty(node.InnerText))
{
  // Do something
}

Thank you very much for the information. It doesn't seem to be working, since the 'empty nodes' are still not activating the code inside when they should be. I can't do what you did exactly, however, because (I think) I can only do that with XmlDocument and so on instead of XmlTextReader, since InnerText isn't available for me to call. I used LocalName as a best guess for what the equivalent would be. Here's my actual code snippet - the idea is to add what's in <imagename> if there's something there, but if not to add what's in <text>:

code:
        public void getXml(string aPath)
        {
            try
            {
                XmlTextReader reader = new XmlTextReader(aPath);
                while (reader.Read())
                {
                    if (reader.NodeType == XmlNodeType.Element)
                    {
                        switch (reader.LocalName)
                        {
                            case "imagename":
                                if (String.IsNullOrEmpty(reader.LocalName))
                                {
                                    isImage = false;
                                }
                                else
                                {
                                    imagename.Add(reader.ReadString());
                                    isImage = true;
                                }
                                break;
                            case "text":
                                if (String.IsNullOrEmpty(reader.LocalName))
                                {
                                    if (isImage == false)
                                    {
                                        imagename.Add(reader.ReadString());
                                    }
                                }
                                break;

                        }
                    }
                }
                reader.Close();
            }
        }

casseopei fucked around with this message at 21:50 on Jul 11, 2007

csammis
Aug 26, 2003

Mental Institution

casseopei posted:

I used LocalName as a best guess for what the equivalent would be.

That's not what LocalName is...don't guess, use MSDN :) In fact, you already have your answer. ReadString() returns the contents, so if that returns a blank string, you've found your empty element.


edit: You're also already using LocalName in the switch statement, so that wouldn't be returning a blank string at all :confused:

casseopei
Jun 21, 2006

csammis posted:

That's not what LocalName is...don't guess, use MSDN :) In fact, you already have your answer. ReadString() returns the contents, so if that returns a blank string, you've found your empty element.

I am insane. Ok, thanks a lot, it's working now! :) I was wrong with my syntax but was also wrong logically, and now it's all straightened out.

casseopei fucked around with this message at 22:35 on Jul 11, 2007

Munkeymon
Aug 14, 2003

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



pliable posted:

Doesn't seem to work. It seems that Explorer wants to keep a permanent lock for some reason on the file, so it's constantly throwing exceptions.

This is depressing :(. Regardless, thanks for the help so far guys, I appreciate it.

The directory you're watching isn't on a network share by any chance is it? Windows has some weird hangups about files on network shares that could be causing that error. Try getting WhoLockMe to see if it's really locked or if the error is innaccurate.

Edit: You should still try seeing what's locking it, if anything, to see if the error is correct. I know I get some weird messages back on Vista from programs that aren't aware they can't write to places for security reasons and I have seen weird erros on XP cause by 3rd party software. Better to be sure at any rate.

Munkeymon fucked around with this message at 22:56 on Jul 11, 2007

pliable
Sep 26, 2003

this is what u get for "180 x 180 avatars"

this is what u fucking get u bithc
Fun Shoe

Munkeymon posted:

The directory you're watching isn't on a network share by any chance is it? Windows has some weird hangups about files on network shares that could be causing that error. Try getting WhoLockMe to see if it's really locked or if the error is innaccurate.

Nah, I'm running and testing this on my local PC.

Sabotaged
Jul 6, 2004

In asp.net 1.1, what's the best way to retain form values while going to another page on the server, to restore when the user navigates (not with the browser back button) back? It seemed like saving the page's viewstate might be an option, but after reading around a little bit, this seems like something it was not intended for. I was even reading viewstate does not hold form values. Is this true?

Basically I'm just trying to make a "wizard" style data entry application that lets the user go forwards and backwards. I could probably rig something like manually loops through a page's controls and saving them to the session, but that seems ugly.

salithus
Nov 18, 2005
After all that work to get the DataGridView working, I realized that putting the connection et al into the MdiChild was stupid, since the results from the SQL query are static while the user has the application open, no matter how many documents they use.

So, what's the best practice for moving this to the MdiParent?

I think that I need to move the DataSet to the MdiParent and give each MdiChild its own BindingSource that's bound to DataSet. Since MdiChild isn't inherited from MdiParent, I can't use protected. Is setting up the DataSet as an internal what I'm looking for, or is there a better way?

salithus fucked around with this message at 14:49 on Jul 12, 2007

wwb
Aug 17, 2004

Sabotaged posted:

In asp.net 1.1, what's the best way to retain form values while going to another page on the server, to restore when the user navigates (not with the browser back button) back? It seemed like saving the page's viewstate might be an option, but after reading around a little bit, this seems like something it was not intended for. I was even reading viewstate does not hold form values. Is this true?

Basically I'm just trying to make a "wizard" style data entry application that lets the user go forwards and backwards. I could probably rig something like manually loops through a page's controls and saving them to the session, but that seems ugly.

The easiest way is to simulate the ASP.NET 2.0 wizard controls never have them leave the page. Just show and hide panels as needed. PROTIP: encapsulate panels in user controls so you don't get insane amounts of code on one page. PROTIP2: use viewstate-backed properties to save internal state on the page for things like page number and such.

I wrote a lot of those type things back in the 1.1 days . . .

Richard Noggin
Jun 6, 2005
Redneck By Default

Sabotaged posted:

In asp.net 1.1, what's the best way to retain form values while going to another page on the server, to restore when the user navigates (not with the browser back button) back? It seemed like saving the page's viewstate might be an option, but after reading around a little bit, this seems like something it was not intended for. I was even reading viewstate does not hold form values. Is this true?

Basically I'm just trying to make a "wizard" style data entry application that lets the user go forwards and backwards. I could probably rig something like manually loops through a page's controls and saving them to the session, but that seems ugly.

While I'm not sure it's the best way, session variables do exactly that. http://msdn2.microsoft.com/en-us/library/87069683.aspx

Fastbreak
Jul 4, 2002
Don't worry, I had ten bucks.

Richard Noggin posted:

While I'm not sure it's the best way, session variables do exactly that. http://msdn2.microsoft.com/en-us/library/87069683.aspx

In 1.1, thats what session variables are used for alot. The idea of keeping it all on the same page and show/hide panels works fine but the viewstate will be much larger and debugging is more painful. So it is a give and take.

Inquisitus
Aug 4, 2006

I have a large barge with a radio antenna on it.
Is there a way of finding the client area of a window as a rectangle, relative to the entire desktop (using the window's handle)? I've found two API functions which almost do this, but neither do quite what I want:
  • GetWindowRect() - gets a rectangle representing the outer bounds of the window (i.e. including the borders and title bar).
  • GetClientRect() - gets a rectangle that represents the size of the window's client area (i.e. the upper-left corner is always 0,0).
I guess what I need is a combination of these functions, but I can't find one :(

Edit: I found a slightly hacky way of doing it: you just calculate the width of the borders from the rectangles received from each of these functions (by subtracting the width of the client area from the width of the window and dividing by 2) and you can then find where the client area lies within the window:
code:
private static Rectangle GetClientArea(IntPtr handle)
{
    RECT win32Rectangle;

    // Get the window's outer bounds.
    bool success = GetWindowRect(handle, out win32Rectangle);
    if (!success)
    {
        throw new Win32Exception();
    }
    Rectangle windowBounds = win32Rectangle.GetRectangle();
    Size windowSize = windowBounds.Size;

    // Get the size of the window's client area.
    success = GetClientRect(handle, out win32Rectangle);
    if (!success)
    {
        throw new Win32Exception();
    }
    Size clientSize = win32Rectangle.GetRectangle().Size;

    // Calculate the coordinates of the client area.
    int borderWidth = (windowSize.Width - clientSize.Width) / 2;
    int verticalExcess = windowSize.Height - clientSize.Height;
    int x = windowBounds.X + borderWidth;
    int y = windowBounds.Y + (verticalExcess - borderWidth);
    Rectangle clientBounds = new Rectangle(x, y, clientSize.Width, clientSize.Height);

    return clientBounds;
}

Inquisitus fucked around with this message at 20:16 on Jul 12, 2007

MrBishop
Sep 30, 2006

I see what you did there...

Soiled Meat
What's a good way to check to see if an assembly exists in the GAC? I have a couple small apps that get used in our office, that rely on a third-party assembly. Basically, I just need to do a check, then pop up a message "HAY GUYZ, YOU FORGOT TO INSTALL <REQUIRED COMPONENT>" if it's not there.

Note that this is only required for a part of the program that gets used rarely; so, I don't necessarily want to prevent them from running the program if it's not there. Likewise, using Assembly.Load() every time the program starts didn't seem great either.

salithus
Nov 18, 2005

MrBishop posted:

What's a good way to check to see if an assembly exists in the GAC? I have a couple small apps that get used in our office, that rely on a third-party assembly. Basically, I just need to do a check, then pop up a message "HAY GUYZ, YOU FORGOT TO INSTALL <REQUIRED COMPONENT>" if it's not there.

Note that this is only required for a part of the program that gets used rarely; so, I don't necessarily want to prevent them from running the program if it's not there. Likewise, using Assembly.Load() every time the program starts didn't seem great either.

If it's rarely used, I'd think that it'd be better to check it when it's actually needed.

According to this you should be able to run "gacutil.exe /l <assemblyName>" and parse it. I dunno about that though.

ljw1004
Jan 18, 2005

rum

Inquisitus posted:

Is there a way of finding the client area of a window as a rectangle, relative to the entire desktop (using the window's handle)?

The API way:
code:
RECT rc; GetClientRect(hwnd,&rc);
ClientToScreen(hwnd, &rc.left);
ClientToScreen(hwnd, &rc.right);
I'm sure there are equivalent Windows.Forms functions. (NB. the code above uses a bit of trickery. "RECT rc" is a structure {left,top,right,bottom}. The ClientToScreen function expects a point {x,y}. When we pass it &rc.left we're implicitly passing it {left,top}. And likewise &rc.right.

havelock
Jan 20, 2004

IGNORE ME
Soiled Meat

MrBishop posted:

What's a good way to check to see if an assembly exists in the GAC? I have a couple small apps that get used in our office, that rely on a third-party assembly. Basically, I just need to do a check, then pop up a message "HAY GUYZ, YOU FORGOT TO INSTALL <REQUIRED COMPONENT>" if it's not there.

Note that this is only required for a part of the program that gets used rarely; so, I don't necessarily want to prevent them from running the program if it's not there. Likewise, using Assembly.Load() every time the program starts didn't seem great either.

I think Assembly.Load is fine because if that part of your app uses the assembly, it's going to get loaded anyway. It's probably best to defer the call until they try to access that part of the app. You could see whether or not the assembly was loaded (so the check only happens the first time) and then try to load it if it isn't.

Inquisitus
Aug 4, 2006

I have a large barge with a radio antenna on it.

ljw1004 posted:

The API way:
code:
RECT rc; GetClientRect(hwnd,&rc);
ClientToScreen(hwnd, &rc.left);
ClientToScreen(hwnd, &rc.right);
I'm sure there are equivalent Windows.Forms functions. (NB. the code above uses a bit of trickery. "RECT rc" is a structure {left,top,right,bottom}. The ClientToScreen function expects a point {x,y}. When we pass it &rc.left we're implicitly passing it {left,top}. And likewise &rc.right.
Perfect, thanks :)

Much better than my way :shobon:

Inquisitus fucked around with this message at 21:02 on Jul 12, 2007

Adbot
ADBOT LOVES YOU

wwb
Aug 17, 2004

Fastbreak posted:

In 1.1, thats what session variables are used for alot. The idea of keeping it all on the same page and show/hide panels works fine but the viewstate will be much larger and debugging is more painful. So it is a give and take.

I have done this both ways and unless you are severely bandwidth constrained, inpage controls are the way to go. Main issue is that bad things can happen to sessions with little or no warning, causing interesting issues. Or making you do a whole lot of defensive programming. Whereas with a series of panels one can be reasonably assured that things are lying about in ViewState.

As for keeping the codebase managable, that is what user controls are for. Use them like webparts to pass bits of business information back and forth. They are your friends.

  • Locked thread