|
READ the responses!!! I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Same question as below, just asked a different way. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi
i am writing the code in aspx page
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server">
<Services>
<asp:ServiceReference Path="MyAutocompleteService.asmx" />
</Services>
</asp:ScriptManager>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<div id="divWidth">
</div>
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" ServicePath="MyAutocompleteService.asmx"
ServiceMethod="GetEmailsIdString" TargetControlID="TextBox1" MinimumPrefixLength="1"
CompletionInterval="10" EnableCaching="true" CompletionSetCount="12" CompletionListCssClass="AutoExtender"
CompletionListItemCssClass="AutoExtenderList" CompletionListHighlightedItemCssClass="AutoExtenderHighlight"
CompletionListElementID="divWidth">
</cc1:AutoCompleteExtender>
</div>
</form>
</body>
</html>
in webservice
using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Collections.Generic;
using System.Xml;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
/// &lt;summary&gt;
/// Summary description for MyAutocompleteService
/// &lt;/summary&gt;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class MyAutocompleteService : System.Web.Services.WebService
{
public MyAutocompleteService()
{
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string[] GetSuggestions(string prefixText, int count)
{
List&lt;string&gt; responses = new List&lt;string&gt;();
for (int i = 0; i &lt; count; i++)
responses.Add(prefixText + (char)(i + 65));
return responses.ToArray();
}
[WebMethod]
public string[] GetEmailsIdString(string prefixText, int count)
{
List&lt;string&gt; responses = new List&lt;string&gt;();
DataSet ds = new DataSet();
string conString = ConfigurationManager.ConnectionStrings["SqlOpenRopes"].ToString();
SqlConnection con = new SqlConnection(conString);
con.Open();
SqlDataAdapter da;
SqlCommand sqlCmd = new SqlCommand();
sqlCmd = new SqlCommand("SELECT ReservationId,Email FROM Reservations where email !='' AND Email Like '" + prefixText + "%'", con);
da = new SqlDataAdapter(sqlCmd);
da.Fill(ds);
if (ds != null)
{
for (int i = 0; i &lt; ds.Tables[0].Rows.Count; i++)
responses.Add(ds.Tables[0].Rows[i]["Email"].ToString());
}
con.Close();
//for (int i = 0; i &lt; count; i++)
// responses.Add(prefixText + (char)(i + 65));
return responses.ToArray();
}
}
when running this code is executed the code but the output is not displaying what changes i want to do......
|
|
|
|
|
hi,
try adding this before your methods: [System.Web.Script.Services.ScriptMethod]Sara, CAPM
|
|
|
|
|
When posting code here you need to format it using pre tags I know the language. I've read a book. - _Madmatt
|
|
|
|
|
iam using asp.net with c#. i want to get alphanumeric no which should be auto generated from database
example (nt234,st675) can any body help ...
|
|
|
|
|
|
you can take help from following link,
http://blog.sqlauthority.com/2007/04/29/sql-server-random-number-generator-script-sql-query/
Hope it will help,Bajrang Singh
Using .net 2.0 (VS2005)
|
|
|
|
|
I create a Datalist and add photos to it in Asp.net.
I need to enlarge the photo when it click.
Selected picture only enlarge when it press and press on other enlarge that picture
Thanks
vipin o.s
|
|
|
|
|
You can use AJAX Model Popup Extender
Or can do using Javascript by show/hide div
onmouseover="showLarge('images\largeImage.jpg');"Best Regards,
Chetan Patel
|
|
|
|
|
As Chetan suggested you can AJAX Modal Popup or you can use JQuery
|
|
|
|
|
|
Problem loading stylesheet - not loaded because its MIME type, "text/html", is not "text/css".
|
|
|
|
|
The reference required should look like:
<link href="CSS/Screen.css" rel="stylesheet" type="text/css" media="screen" /> Tychotics: take us back to the moon
"Life, for ever dying to be born afresh, for ever young and eager, will presently stand upon this earth as upon a footstool, and stretch out its realm amidst the stars."
H. G. Wells
|
|
|
|
|
Thanks for your reply! I found the solution. In my case,
the particular part is mentioned under 'deny user'(while not logged on) category in web.config.That's y the style sheet was not loaded. I resolved this by mentioned the 'allow user' property.
|
|
|
|
|
For this article I have used date validation. There is already asp tag to validate date.
<asp:CompareValidator id="dateValidator" runat="server" Type="Date" Operator="DataTypeCheck" ControlToValidate="txtDob" ErrorMessage="Not a valid date."></asp:CompareValidator>
This method doesn't validate all date format.
The following method will validate all date format.See Detail posting
click here to see solution
|
|
|
|
|
Hello,
I have following javascript below it works fine with IE explorer when i try to insert special characters in textbox it does not except it. But when i run this in firefox it does not have any effect it excepts special characters in texbox.Can anybody solve this problem it will be a great help? Thanks in Advance.
<script language="JavaScript" type="text/javascript">
function NumberOnly()
{
var keyASCII = window.event.keyCode;
var keyValue = String.fromCharCode(keyASCII);
if (!(keyASCII >= '97' && keyASCII <= '122') && !(keyASCII >= '65' && keyASCII <= '91') && !(keyValue >= '0' && keyValue <= '9'))
{
window.event.keyCode = 0;
}
}
</script>
<asp:TextBox ID="txtbName" onkeypress = "NumberOnly()" runat="server" BorderStyle="Solid"
BorderWidth="1px" BorderColor="#CCCCCC" BackColor="White" Width="150px"
CausesValidation="True" Height="20px" MaxLength="50"></asp:TextBox>
|
|
|
|
|
http://www.google.com/search?hl=en&q=keycode+javascript+firefox+%26+IE&aq=f&oq=&aqiLife Is Beautiful
modified on Saturday, February 20, 2010 6:32 AM
|
|
|
|
|
use the bellow code..
if (window.event)
{
keyASCII = window.event.keyCode;
}
else if (event.which)
{
keyASCII = event.which;
}
|
|
|
|
|
Can anyone tell me how to retrieve the system name and ip address of the local machine???
|
|
|
|
|
|
Hi
Thanks a lot. Can u help me out with the other post i ve sent too pl??
|
|
|
|
|
Check Out..! I already posted..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
What do you mean by local machine ? You want IP Address of Server or Client Systems ?
|
|
|
|
|
If you want the IP of client machine,You can use the server variables. Cheers!!
Brij
|
|
|
|