|
Thank you
Vikram
I Code...
|
|
|
|
|
Vikram..... wrote: For my website .. i want to disable user from using back button of the browser.
For my browser... i want the back button to always work.
What you want is sketchy at best - yes, there are certain hacks that can kinda do what you want, but there's no promise that they'll work on all browsers or for all users, and unless you are very careful can actually make things worse in situations where your real goal is to prevent multiple posts or equiv.
Design your system so that it is tolerant of the user using their browser.
|
|
|
|
|
Hi i need to check pattern of a file name using Regular Expression.
The file name is something like "TRANS#7_26_2007.xls" ie "TRANS#[MM]_[DD]_[YYYY].xls"
Can any one please help me.... Thanks,....
Vikram
I Code...
|
|
|
|
|
Hi Vikram
I think the pattern you need is TRANS#\d{1,2}_\d{1,2}_\d{4}\.xls .
The "\d" matches any numeric character.
The "{x,y}" pattern matches the preceding character between x and y times (i.e. your example showed that the months may be expressed as a single digit).
The "{4}" pattern matches the preceding character exactly 4 times.
The "\" says to treat the following character as a literal (because "." is a special matching character).
Hope that helps.
Regards
Andy
I code too...
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message".
|
|
|
|
|
Hi,
I need some help in writing a regular expression. I normally do checks, but in this case I need something else. I have a textare control, and I need to extract all the numbers. There is text in between as well, but I need to get all the numbers separately.
What I have here extracts a wide variety of numbers, like: 321.0, 321, -0.020, -0.02, 3.0E-17, 3E-17, 1, 34, etc. I need just whole numbers, it's for ISBN. I want it to search for number, but if a there is a number like 999-999 I need it to remove the - as well.
I am using ASP.NET 1.1 and VB.NET 1.1.
Regards,
ma se
|
|
|
|
|
I don't have VS.Net on this PC, but the following should do the trick:
[0-9]-?[0-9]-?[0-9]-?[0-9]-?[0-9]-?[0-9]-?[0-9]-?[0-9]-?[0-9]-?[0-9]
or
\d-?\d-?\d-?\d-?\d-?\d-?\d-?\d-?\d-?\d
Regards
Andy
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message".
|
|
|
|
|
Hello,
I m facing a problem attaching a parameterized function onkeypress of textboxes that are getting created at runtime using document.createElement()
Need advices...
Here is the code:
The problem is that the event is neatly attached to every textbox object.
But the Object parameter that is passed to anonymuous method always takes the loop's last iteration textbox textbox-object for each textbox-object
function CreateTextBoxes(NumOfBoxes, ContainerID)
{
document.getElementById(ContainerID).innerHTML="";
for (i=0;i<parseInt(NumOfBoxes) ; i++)
{
var oTextBox="";
oTextBox=document.createElement("input");
oTextBox.id="Age"+i;
oTextBox.size="5";
document.getElementById(DependentsContainerID).appendChild(oTextBox);
document.getElementById(ContainerID).innerHTML+=" ";
}
var TextBoxId="";
for(i=0;i<parseInt(NumOfBoxes) ; i++)
{
TextBoxId="Age"+i;
document.getElementById(TextBoxId).onkeypress=function(){LimitChars(document.getElementById(TextBoxId),"3","Numbers");}
}
}
}
Help will be greatly appreciated!!!
Thanks,
Pranav
-- modified at 6:10 Wednesday 1st August, 2007
|
|
|
|
|
Pranav Kaushik wrote:
TextBoxId="Age"+i;
document.getElementById(TextBoxId).onkeypress=function(){
LimitChars(document.getElementById(TextBoxId),"3","Numbers");
}
You need to change as below.
TextBoxId="Age"+i;<br />
document.getElementById(TextBoxId).onkeypress=function(){ LimitChars(document.getElementById(<big>this.id</big>),"3","Numbers");}<br />
Here is my test script for you..
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br />
<html xmlns="http://www.w3.org/1999/xhtml" ><br />
<head> <title>Untitled Page</title><br />
<script language="javascript"><br />
function CreateTextBoxes(NumOfBoxes, ContainerID) {<br />
document.getElementById(ContainerID).innerHTML="";<br />
for (i=0;i<parseInt(NumOfBoxes) ; i++) {<br />
var oTextBox="";<br />
oTextBox=document.createElement("input");<br />
oTextBox.id="Age"+i;<br />
oTextBox.size="9";<br />
oTextBox.value = "Value Age" + i;<br />
document.getElementById('DependentsContainerID').appendChild(oTextBox);<br />
document.getElementById(ContainerID).innerHTML+=" ";<br />
}<br />
var TextBoxId="";<br />
for(i=0;i<parseInt(NumOfBoxes) ; i++) {<br />
TextBoxId="Age"+i;<br />
document.getElementById(TextBoxId).onkeypress=function(){ alert(document.getElementById(this.id).value);<br />
}<br />
}<br />
}<br />
</script><br />
</head><br />
<body><br />
<div id="DependentsContainerID"></div><br />
<div id="ContainerID"></div><br />
<input type="button" value="Create Textboxes" onclick="CreateTextBoxes(10,'ContainerID');"<br />
/><br />
</body><br />
</html>
Hope it helps.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
hi
I registered a site with this address "MyProject.com"
and now I want to redirect every address like " ____.MyProject.com" to "MyProject.com"
ex:
mail.MyProject.com
ex:
login.MyProject.com
How can i configure IIS?
or How can i configure DNS server.
|
|
|
|
|
There is something called a host header in IIS. This allows you to map multiple web addresses to one IP address. If you open computer management and go to your web site and right click and select properties. On The web site tab there is an advanced button. The top part is where you add the multiple identities for the web site. NOTE: I believe you have to enter each of them in, I do not believe wild cards work. So you would have to enter mail.MyProject.com, login.MyProject.com etc.
Then you will have to configure you DNS server with all of the same mappings, so your DNS server knows which IP to route traffic.
Hope that helps.
Ben
|
|
|
|
|
hi
I configure DNS server.my Site with "MyProject.com" has 150.150.0.1 ip address.and other address like "___.MyProject.com" redirect to 150.150.0.1
ex:
from command line client computer
ping nnn.MyProject.com
150.150.0.1
but
when I write this address in ie address bar it return an error that says:
Page is under construction
howcan i fix it?
|
|
|
|
|
Did you configure your web site in IIS like I said in my previous post? You have to add the host headers in the advanced screen for the site to respond to the different URLs.
Ben
|
|
|
|
|
yes
But Ihae problem yet?!
|
|
|
|
|
I would guess that you didn't set up your default page correctly. What page is suppose to be the start page of your web site? In IIS you need to set it there. In IIS in the properties for the web site there is a tab called document. Usually there is Default.htm etc. You need to add your start page to the top of the list.
Hope that helps.
Ben
|
|
|
|
|
Thank you.
I cannt explain my problem more.
thank u for your answer.
|
|
|
|
|
This is my venture into the world of Web programming, so please be verbose in your answers.
I have a WinForms app which accesses a webservice which accesses a database and then returns some XML to the WinForms app.
I am currently in debug mode, and webservice is created OK. I get valid data back if I remove the database code from the equation.
My code to access the database in the webservice is:
<code>
//Connecting to Northwind database
string ConStr = "Initial Catalog=Northwind;Data Source=localhost;Integrated Security=SSPI;";
SqlConnection myconnection = new SqlConnection(ConStr);
myconnection.Open();
SqlCommand mycommand = new SqlCommand("Select * from Customers", myconnection);
SqlDataReader dr = mycommand.ExecuteReader();
dr.Read();</code>
I receive an error: An error has occurred while establishing a connection to the server.
What steps do I need to take (in both the virtual and real server) for the webservice to see the database?
Regards
Andrew
|
|
|
|
|
In your connection string in the Data Source you have it set to localhost. That is not a valid sql server name. You need to put in the name of your sql server and make sure that your server that your web service is running on can resolve the sql server name to the correct IP address.
Hope that helps.
Ben
|
|
|
|
|
I have altered the Northwind file and added
"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\SampleDatabases\NORTHWND.MDF;Integrated Security=True;Connect Timeout=30;User Instance=True" as a connection string.
Error:
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.SqlClient.SqlException: Unable to open the physical file "C:\SampleDatabases\NORTHWND.MDF". Operating system error 5: "5(error not found)".
An attempt to attach an auto-named database for file C:\SampleDatabases\NORTHWND.MDF failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
Regards
Andrew
|
|
|
|
|
So it looks like the database file doesn't exist where it is expecting it. Or perhaps your web app doesn't have rights to read it. Normally you would put a sqlexpress file in the app_data folder of your web service. Then it should have access to it.
Ben
|
|
|
|
|
OK Thanks.
I tried another connection string and got a different error.
string ConStr =@"Server=localhost\SQLEXPRESS;database=databasename;Integrated Security=True";
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.SqlClient.SqlException: Cannot open database "ValuePro" requested by the login. The login failed.
Login failed for user 'USERNAME\ASPNET'.
Andrew
|
|
|
|
|
So you are using integrated security, which by default is aspnet user. You may need to change your connection string to use a set sqluser and sql password. If you still want to use integrated security, you will have to create a new application pool. Have your webservice user that app pool. Then you will have to create a new network user for the identity of the app pool. add that user to IIS_wpg group. Set the identity of the app pool to that user. Add that user to the sqlexpress database with the correct rights.
Ben
|
|
|
|
|
I am primarily an ASP .Net developer, but i have had some classic asp work come my way.
I am running into a problem with the submit funtion in forms. i have requiements for the following:
if the user checks a checkbox, then clicks save on one form, the page reloads, but the checkbox is no longer checked. hopw do i maintain the checked state of a checkbox? same for the selected items in a listbox control.
Also, some of the buttons on one form cause the page to submit, but it loads back at the top of the page. how does one modify the submit in the vb code to navigate to a named anchor (ie, page.asp#here)?
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
Vodstok wrote: hopw do i maintain the checked state of a checkbox
Render checked as the attribute of checkbox tag.
|
|
|
|
|
I'm looking for a good javascript compressor. Not specifically for obfuscation, but to ensure that the download payload is as small as possible.
Anyone using any they could recommend?
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
Well, there's always this[^] one. I've had some success with it.
Deja View - the feeling that you've seen this post before.
|
|
|
|