|
I use RouteCollection with FriendlyUrlSettings to remove aspx from being shown... so now every time someone access my site, instead of display www.mysite.com/login.aspx , it will display www.mysite.com/login
But I have a problem where an old app needs to access a page, and it's already hard-coded inside the app to access www.mysite.com/service/AuthenticateUser.aspx page. But because of the friendlyurl, the app doesn't work.
So I added this line
routes.Ignore("Service/AuthenticateUser.aspx");
but it doesn't seem to do anything. Every time I access the page Service/AuthenticateUser.aspx , it will still redirect me to Service/AuthenticateUser only
|
|
|
|
|
How about asking this in the ASP.NET forum as it has nothing to do with C#.
|
|
|
|
|
err... why is this a asp.net question? As per my understanding, the codes that handles the ignoring of specific file or folder needs to be written in the back code (c#) in my case.
public static void RegisterRoutes(RouteCollection routes)
{
routes.RouteExistingFiles = false;
routes.Ignore("SERVICE/{*pathInfo}");
var settings = new FriendlyUrlSettings();
settings.AutoRedirectMode = RedirectMode.Permanent;
routes.EnableFriendlyUrls(settings);
}
the code above is what I did but still doesn't work
|
|
|
|
|
Because you're asking about the functionality of ASP.NET and/or possibly MVC routing.
|
|
|
|
|
Hello there. I am given a small xml script. How can I use that script to change the frame rate of this IP camera. Thanks for any input.
|
|
|
|
|
The question is not clear. Please explain what C# issues you are having problems with.
|
|
|
|
|
Well, I would say that you need to read some value from your XML file. It will either be an attribute or an element. Oh wait, it might be a set of values that you use to calculate the rate. If it is, you will have to read the values in and apply whatever calculation is appropriate. However, unless I'm greatly mistaken, IP cameras don't use framerates - they use bandwidth, and while you may be able to change the frame rate, the underlying bandwidth might not be able to cope.
As for actually choosing a frame rate and displaying your images then why not look at Aforge and set the DesiredFrameRate[^].
|
|
|
|
|
I have a textBox where i want to insert a string in a licence model (fdsf-dfss-fdfd-fdhd). I tried to select first 4 char and when I have 4 chars, is inserted "-". But it starts from the beginning when "-" is inserted after first 4 chars. This is how I tried:
private void textBox4_TextChanged(object sender, EventArgs e)
{
for (int i=0;i<=textBox4.Text.Length;i++)
{
while (textBox4.Text.Length == 4)
{
textBox4.Text += "-";
}
}
}
How can I make like after I have 4 chars and "-" is inserted, to be able to continue inserting the text after "-" ?
|
|
|
|
|
|
|
Change it to:
textBox4.Text += "-";
textBox4.SelectionStart = textBox4.Text.Length;
..in order to set the input cursor to the end of the text again.
Unrelated suggestion: Give your TextBoxes and all other controls a name that explains their purpose - in this case maybe "LicenceInput". That will make it much easier to read your code, even for yourself, after you haven't worked on it for a while
edit: A MaskedTextBox might be the most convenient way to handle this. The input mask would be: 0000\-0000\-0000\-0000
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
modified 20-Apr-15 7:15am.
|
|
|
|
|
it works, but after I insert another 4 characters, "-" is not inserted.
|
|
|
|
|
Please edit your original post and add your reworked code in a second code-block.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
On second thought, the modulo operator-approach isn't really well suited here, because due to inserting the dashes, the length of the text won't be a multiple of 4 at the positions where the next dash should be inserted. I would recommend a MaskedTextBox instead with an input mask like 0000\-0000\-0000\-0000
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
I can insert only numbers..
|
|
|
|
|
|
Is ok, I solved it. Thank you !
|
|
|
|
|
Too late I already replied ;o)
You're welcome!
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
is this a web app or windows app? If it is windows then you can use Masked Input and if it is web then you can use Jquery, don't need to hit server every time..
|
|
|
|
|
Is win form. I will try, thanks!
|
|
|
|
|
|
I've used masked textbox many times, just remember to set the mask and it will do all the work for you.
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
How Can I Export Database From Sql Server To Sql Server Ce
|
|
|
|
|
|