|
Sorry, here it is:
I have the following entry in web.config:
<httpModules>
<add type="URLChanger.ChangeURL,URLChanger" name="URLChanger" />
</httpModules>
Should I add another one or update this one?
I'm kinda new to this stuff.
|
|
|
|
|
Oops, cross my handlers with my modules again. I corrected the code, but your IHttpModule implementation has nothing to do with the handler for the .asp files, which leads me to ask what are you trying to do?
To remove the HttpForbiddenHandler for the .asp file, you need to add this in your Web.config (don't duplicate the >httpHandlers> section obviously):
<httpHandlers>
<remove verb="*" path="*.asp"/>
</httpHandlers>
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Great!!!! I really appreciate the help.
It worked but I still need to test the full project I'm working on.
What I'm trying to do is that my company has a list of customers who have their mini sites on our server. For example http://www.mysite.com/customer1/default.asp. Most of the customers have this link on their business documents.
We have 2 domains pointing to same IP. Let's say you type www.mysite.com or www.mycompany.com and both goes to same location.
Now my company is making one domain a whole different site but they don't want to bother customers to change their mini site location.
So, my project is to check the url on new domain and if the url has a customer folder name within, I should redirect it to other domain to correct url. All the pages are in .asp
I'm planning to have all the customer folder names in one XML file and use HttpModule class to check the folder name in XML file and redirect it. THe challenge here is that if url doesn't have matching folder in XML it should'n do anything and display the file from local server.
I don't know if you have any interest in this but if you do I can bug you again in case I get stuck somewhere.
Many thanks for your help.
|
|
|
|
|
When you anchor two opposing sides, the control is stretched so that the distance between the parent's edges and the child's edges remain the same.
Anchoring and docking doesn't always solve the problem, though, in cases where you need to resize two controls adject to each other and retain the same relative widths, and in similar cases. Just handle the Resize event of the parent control (or override OnResize in your parent control if you want the parent to resize the children) and adjust your sizes and locations accordingly.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Try the documentation. You'll see the Resize event that's inheritted from Control . To get the size of the parent, simlpy get it Size property. You'll need a reference to the parent, which is why the Parent property is inheritted from all controls. So just call Size size = Parent.Size in the Resize event handler and adjust your Size and Location accordingly. You only need to do this, though, if anchoring doesn't give you the layout you need. Try anchoring first. If you need more information on anchoring, check the documentation for the Control.Anchor property in the .NET Framework SDK.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Yes, but you have to handle the event in your child controls.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Your child control handles the parent's Resize event. You only override OnResize in the parent when you want the parent to resize the child controls, for example:
public class MyParent : Form
{
private MyChild uc1;
public MyParent()
{
uc1 = new MyChild();
uc1.Location = new Point(8, 8);
uc1.Size = new Size(Width - 16, Height - 16);
Controls.Add(uc1);
}
protected override void OnResize(EventHandler e)
{
uc1.Size = new Size(Width - 16, Height - 16);
}
}
public class MyChild : UserControl
{
} This is a simple example of the parent resizing the child.
A simple example of the child resizing itself follows:
public class MyParent : Form
{
}
public class MyChild : UserControl
{
protected override void OnParentChanged(EventArgs e)
{
if (Parent != null)
Parent.Resize += new EventHandler(Parent_Resize);
}
private void Parent_Resize(object sender, EventArgs e)
{
this.Size = new Size(Parent.Size.Width - 16, Parent.Size.Height - 16);
}
} In both of these cases, the Anchor property is better suited. Just put the control in the right position and size it like you want it, then set the edges that you want to anchor to. Read about the Anchor property because the above code for something so simple that the anchoring functionality provides is a complete waste and the simple examples above don't take every condition into account.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Anchor it to a single edge or adject - not opposing edges. Read the documentation for the Anchor and Dock properties.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Have you taken to talking to yourself now, Heath?
Looks like whoever you were talking to killed their account or something...
|
|
|
|
|
He was asking simple questions about resizing. Maybe when he realized what he was doing wrong/how things work he felt ? Who knows. I'm keeping the posts around to keep my message posting total up!
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
you post-harlot (not the soapbox, right?) you
|
|
|
|
|
Hmm, can I change my answer to "keeping them for posterity" then?
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
agreed...how are your memoirs coming along?
|
|
|
|
|
I have an AxWebBrowser control displaying a certain page that has two input boxes. I want to Click a button on the form, and have values inserted into those two input boxes. How can I do that?
Sammy
"A good friend, is like a good book: the inside is better than the cover..."
|
|
|
|
|
If the button is in the web page, then just use embedded javascript in your page.
If the button is in your Windows Form, get the IHTMLDocument2 reference from AxWebBrowser.Document (the interface is defined in the Microsoft.mshtml.dll assembly which should be in your GAC when you install VS.NET, among other things). From that, you can enumerate the controls or get them by ID or NAME. Then just set their innerText property or something along those lines.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hey all, I understand how to pull methods/structs out of the dll for use in my C# app, but how do I pull out some #define values for my use in the C# app? I need to do this, becuase all the unmanaged functions return HRESULT values for error checking and I need to check those values for the actual errors which may occur...help!
Jason
|
|
|
|
|
You can't pull #defines out of a .DLL. They are c compilter directives and don't represent any code or data. They're primarily used to define macro's for the compiler to do an advanced search and replace in your code to simplify code writing.
You'll need to go through the original source files for the .DLL, usually the .h files to find the values and their meaning.
Are you looking for Anything in particular?
RageInTheMachine9532
|
|
|
|
|
Ya, I know that...I'd gladly pull them outa the dll, but here's how they are defined:
#define PEER_E_INVALID_RECORD MAKE_HRESULT(SEVERITY_ERROR, FACILITY_P2P, 0x2010)
That's just an example, but they are all similar to that, I don't have an actual value I could use.
|
|
|
|
|
Bottom line is you can't. Their not in the .DLL!
The PEER_E_INVALID_RECORD identifier is replaced with the actual value when the code in compiled. The method in which the value is stored depends heavily on the context that it's used. Most will end up being an operand in an assembly intruction, so they don't show up in the DATA segment in the file .DLL.
Since you have the source, what you could do is write a C++ console app that #include's that header file and just writes out the resulting values of the #define's:
printf("PEER_E_INVALID_RECORD: %x\n", PEER_E_INVLID_RECORD);
RageInTheMachine9532
|
|
|
|
|
That's what I was afraid of....sorry for the confusing posts :P
Thanks
|
|
|
|
|
Short answer:
You don't. #define's are actually replaced in code before the resulting code is compiled.
Example:
#define MY_NUMBER 1
int myNumber = MY_NUMBER;
is converted to this before compiling:
int myNumber = 1;
Jeremy Kimball
|
|
|
|
|
Doing a command line compile with the /P option will output the preprocessor output to a file, which is another possible option, depending on how your code is structured.
This link has an example of using it.
http://msdn.microsoft.com/msdnmag/issues/04/01/windowsshell/default.aspx
My goal is to look at code like a chessmaster looks at a chessboard to see positions and possibilites beyond lines and characters.
|
|
|
|
|
Does anyone know about an implementation of a strongly typed hash-table so I can only change the types and continue in development?
I need need it because of avoiding the boxing/unboxing overhead.
--------
Dave
|
|
|
|
|
Boxing and unboxing only occurs for value types, so if you're adding reference types as keys and values you don't have to worry. Even if you were to find an extendable Hashtable , it will still use object variables to provide generic storage (just like the CollectionBase uses an internal ArrayList ). .NET 2.0 introduces generics that will solve this problem, though.
I know there's none in the .NET FCL but you could always try google. Perhaps you might even find an implementation of IDictionary (always handy to implement appropriate interfaces, which StringDictionary doesn't for some weird reason) for value types.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
check out codeSmith
it has templates for generating type specific container classes.
My goal is to look at code like a chessmaster looks at a chessboard to see positions and possibilites beyond lines and characters.
|
|
|
|