|
MorgSim wrote: I'm not good with Ajax, I am trying to connect to the
database using ajax through asp.net.
What do you mean by connecting DB through Ajax.Ajax is way to postback the page partially.So when you are at server side, you can can connect the DB as normally you do.
Do you mean something else?
Cheers!!
Brij
|
|
|
|
|
ok thanks, for instance, I want a user to enter a userid and upon doing that
I want to connect to the database in the background to check if the id exist, if so,
I will then insert the username for the user.
The whole problem is connecting to the database as the user types which is why I think
ajax would do the trick here even though am not sure how to implement this.
Would you have any help please?
Thanks,
|
|
|
|
|
For that you ealier verion of Ajax ie XMLHTTPRequest objects.You can get a lot on this in Codeproject itself.
Have a look to a sample Click Here
You can also use callback.
There is a control provided in Ajaxtookit.Its very simple to use and might suffice your requirement.
AutoComplete[^]
Cheers!!
Brij
|
|
|
|
|
Thanks alot, I will try it hope it works!
|
|
|
|
|
Best would be to use XMLHttpRequest(old times AJAX! ) in order to implement such kind of feature...
On keypress, fire a XHR and check on server about the typed in data(connecting to database) and get back response accordingly.
if you need to know about it, just google it, you will get number of articles on it!
|
|
|
|
|
I am not sure why this post was voted "1".
I think this is the good answer, hence I upvoted it with my 5.
Cheers !
Abhijit
Codeproject MVP
|
|
|
|
|
You could use ASP.NET AJAX[^] to call a WebService or PageMethod from the client and then use JavaScript and the DOM to show the new data to the user, check this link[^] for samples and tutorials.
|
|
|
|
|
Hi,
i develop a server control that have a property of type List<myitem> where MyItem have a property like List<myitem>.
My intention is to build a control like menu that contains item with list of nested items.
Well, i be able to create the first level of items, but when i insert an item of second level, the designer don't show it.
I don't see the nested item in the aspx page.
How can i create a control like Menu, not deriving from it, and manage in the correct way all the nested collections of items ?
Thanks in advance,
Giuseppe.
|
|
|
|
|
Hi,
This is from Chandra. Can any one tell me What is the difference between 3 Tier Architecture and N-Ties Architecture.
Thanks and Regards
Chandrakanth
|
|
|
|
|
3-Tire architecture consist of 3 layers, Presentation layer, Business Layer and DataAccess layer.
N-Tire architecture has so many n-number of layers... (eg)MVC framework.
|
|
|
|
|
Have a look to the the link Click Here
Cheers!!
Brij
|
|
|
|
|
hi..
how can i limit the internet download using C#.
i.e assume the max download limit is 1GB and when the use exceeds i want to block downloading.
please help me to find a solution
|
|
|
|
|
Clickety
Sathesh.
Blessed is the season which engages the whole world in a conspiracy of love.
|
|
|
|
|
Hi all...
first of all i am new to .NET, when i tried to open a web project which i downloaded from internet i am getting the following error message.
The default Web access mode for this project is set to file share, but the project folder at 'http://localhost/project_name' cannot be opned with the path 'c:\inetpub\wwwroot\project_name'. The error returned was:Unable to open Web project 'project_name'. The web 'project_name' located on server 'http://licalhost' does not exists.
The default Web access mode for this project is set to file share, but the project folder at 'http://localhost/project_name' cannot be opned with the path 'c:\inetpub\wwwroot\project_name'. The error returned was:
Unable to open Web project 'project_name'. The web 'project_name' located on server 'http://licalhost' does not exists.
How to solve this issue..?
|
|
|
|
|
Member 2915399 wrote: 'http://licalhost'
Is this a typo?
I am not sure but may be you can try to place the project folder somewhere outside of inetpub folder and then try to open it.
|
|
|
|
|
May be this problem is from IIS
|
|
|
|
|
Have you created a virtual directory for your Web application under IIS?
The error message looks like VS is not able to find the web project under local host.
You can create a virtual directory in 2 ways -
[SIMPLE]
1. Copy your web proj to c:\Inetpub\wwwroot\ .
2. Open inet manager and locate the newly added folder under the default website.
3. Then "right click -> Properties", here you would see a "Create" button under "Application Settings", just click on it, Apply and close.
4. Refresh your Default website and you are done.
[Advanced]
1. Locate your web proj folder using Windows explorer.
2. Then "Right click -> Sharing and Security -> Web sharing -> Share this folder -> click OK on the new window -> Apply and close".
3. Now your folder would be listed in inet manager.
Proceed with step 2 of the simple process and you are done.
Doing either of these should solve your problem.
HTH!
|
|
|
|
|
Hi,
I wanted a RegEx to allow user to enter phone number in #-###-###-#### or ###-###-#### format only. (Eg: 1-888-456-5678 or 888-456-5678)
I have implemented RegEx[1] to allow user to enter Phone Number in #-###-###-#### format.
What changes do we need to make to the existing RegEx so that it allows user to enter Phone Number in the above 2 formats only?
Thanks in advance.
[1]
@"^\d{1}-\d{3}-\d{3}-\d{4}$"
Regards,
Vipul Mehta
Regards,
Vipul Mehta
|
|
|
|
|
You can just add an OR and put the 2nd type like so -
"^\d{1}-\d{3}-\d{3}-\d{4}$|^\d{3}-\d{3}-\d{4}$"
HTH!
|
|
|
|
|
Thanks Dinesh!! This works well
Regards,
Vipul Mehta
|
|
|
|
|
Your regex should be like this
^(\d{1}-){0,1}\d{3}-\d{3}-\d{4}$
to allow it to capture mentioned two pattern and not any others.
Please let me know if it helps you.
String input = "1-888-456-5678";
String sPattern = @"^(\d{1}-){0,1}\d{3}-\d{3}-\d{4}$";
Regex o = new Regex(sPattern);
Match m= o.Match(input);
if (m.Success)
{
MessageBox.Show("Match found.");
}
else
{
MessageBox.Show("No match");
}
Thanks,
Arindam D Tewary
|
|
|
|
|
Hi,
I am trying to use the TableApapterManager.UpdateAll to insert values to master and child table. I had set the relation to cascade for update in the dataset relation and the HierarchicalUpdate to true. But still when I run TableApapterManager.UpdateAll(dataset), I get a foriegn key violation error. Following is the code I used:
m_adpMgr = new TableAdapterManager();
m_dsMembers = new ArchDemo.DAL.Datasets.dsMembers();
m_adpMgr.MemPhonesTableAdapter = new MemPhonesTableAdapter();
m_adpMgr.MembersTableAdapter = new MembersTableAdapter();
m_adpMgr.MembersTableAdapter.Fill(m_dsMembers.Members);
m_adpMgr.MemPhonesTableAdapter.Fill(m_dsMembers.MemPhones);
int ID;
DAL.Datasets.dsMembers.MembersRow rwMem = m_dsMembers.Members.NewMembersRow();
//Set values to parent table field
rwMem.u_name = mem.Name;
m_dsMembers.Members.AddMembersRow(rwMem);
DAL.Datasets.dsMembers.MemPhonesRow rwmemphn = null;
//Set values to child table field
rwmemphn = m_dsMembers.MemPhones.NewMemPhonesRow();
//Reference key value set here
rwmemphn.u_memberid = ID;
rwmemphn.u_phn = "test";
m_dsMembers.MemPhones.AddMemPhonesRow(rwmemphn);
m_adpMgr.UpdateAll(m_dsMembers);
return ID;
The error I get is "The INSERT statement conflicted with the FOREIGN KEY constraint "FK_MemPhones_Members". The conflict occurred in database "Family", table "dbo.Members", column 'i_memeberid'.
The statement has been terminated."
Can I get some advice on this.
Thanks and Regards,
Satheesh
|
|
|
|
|
The following is a piece of code that I am using to edit some HTML at runtime. My application reads a HTML template in, then replaces the tokens [%0], [%1], [%2], etc with parameter values.
This routine seemed to work fine, until I tried passing a HMTL link to the routine; it then bombs out with the following error message:
'=' is an unexpected token. The expected token is ';'. Line 14, position 91.
If I pass a regular string like "Hello World" to the routine, it works fine.
The string I am passing is:
"<a class='Link' href='http://localhost:2861/activateAccount.aspx?U=y@x.com&K=62cfaea3-ccd1-4831-9d29-985cbae49e2c'>http://localhost:2861/activateAccount.aspx?U=y@x.com&K=62cfaea3-ccd1-4831-9d29-985cbae49e2c</a>"
<br />
' This is actually a method from a class, the variable mXMLdoc is a member value in the class.<br />
<br />
Public Sub MergeData(ByVal ParamArray Args() As String)<br />
Dim i As Integer<br />
<br />
' Replace the [%0], [%1], [%2], etc tokens with parameter values<br />
For i = 0 To Args.GetLength(0) - 1<br />
mXmlDoc.InnerXml = mXmlDoc.InnerXml.Replace("[%" + CStr(i) + "]", Args(i))<br />
Next<br />
<br />
End Sub<br />
Looking forward to getting this resolved ... I'm out of ideas.
|
|
|
|
|
Hi,
You have one "&" in your string that you are passing. Replace '&' with & and I guess it will be solved.
Note the big ampersand here that you should replace.
href='http://localhost:2861/activateAccount.aspx?U=y@x.com<big>&</big>K=62cfaea3
Let me know if you get it going.
Thanks,
Arindam D Tewary
|
|
|
|
|
You were spot on !
I used HttpUtility.HtmlEncode to encode the string to a "safe HTML" format and now things are working fine.
Sometime when you stare a problem too long, you don't see it.
Thanks again,
David
|
|
|
|