|
Hi all,
Currently i am using C#.net 4.0 & JQuery to develop a web project. My problem is I cant invoke the .ashx by using autocomplete(jquery) function. I had done it before in C#.net 3.5 but everything is ok.
below is the sample i done in 4.0:
In UI :
$("[id$='txtApplicant']").autocomplete("../../AutoSuggest.ashx");
In Httphandler :
public void ProcessRequest(HttpContext context)
{
HttpRequest Request = context.Request;
HttpResponse Response = context.Response;
dtResult = getResult(cno,table,field,q);
DataRow[] drs = dtResult.Select();
foreach (DataRow dr in drs)
{
Response.Write(dr["Result"].ToString() + Environment.NewLine);
}
}
Note:
I was put httphandler file outside of the app_code folder (is the must to put in app_code folder?)
and
I din't register any httphandler in web.config
Is something have to configure in web.config?
Any tips or suggest are welcome
Thanks in advance
Cocoonwls
|
|
|
|
|
I have get it work right now. Thanks for those who viewing my post.
Thanks
|
|
|
|
|
This is a volunteer site. People will answer on their time, not yours. Don't be impatient and rude.
If you need immediate help then call Microsoft support and pay
No comment
|
|
|
|
|
Hi Mark,
I don't understand what yours mean but for your information ,since i be a member of this volunteer site, i NEVER (you may view all of my message posted previously...but if you be impatient,you may skip this step )being rude and impatient for others. I am not sure that is any mistake I was made by my previous post then make you comment me like that...but anyway, thanks too because of viewing my question.
p/s: I know if i pay for Microsoft, they will help me immediately. Thanks for your advice.
|
|
|
|
|
hi friends
i am created radiobuttons dynamically
and i am putting it in a list :
say: List<string> lstRadioButton;
i am adding the radiobuttons id to the list and i am also adding the
radio button text and checked value to the list
and on the viewstate(i know that the buttons will not be there)
so i am recreating it with the same id which i got from the list but dont know how to assign the text and checked value
if am doing all these in order to get which of the radio buttons is checked...
hope u got my question.
K.Gayathri
|
|
|
|
|
Hi Gayathri,
In order to get the radiobutton checked state you have to call some event handler on which you might do the coding like this :
Button1_Click(Object sender,EventArgs e)
{
RadioButton rd=(RadioButton)sender;
string id=rd.id;
// It will provide you the Id of RadioButton clicked dynamically.
}
If you are having any other problem, Please post the whole code or mail the code to me on my e-mail id nitisharora007@gmail.com
thanks & regards
Nitish Arora
Web Developer(Learner)
|
|
|
|
|
hi
thanks for the reply
but if i click the button i am not able to get the value(i mean the checked radiobuttons id)
but on post back it says that the radiobuttons do not exist so i have recreated them on every post back but could not make the radiobuttons checked value to be set instead i am able to get only the id.
plz do help me...
stuck with this and not able to proceed further...
K.Gayathri
|
|
|
|
|
hi friends
can anyone help me with this issue plz:
i am creating dynamic radio buttons based on the values i choose from a dropdownlist and if i click the save button i am not able to get the radiobuttons clicked ids so how to do it.....
looking for help....
K.Gayathri
|
|
|
|
|
i am using the following code
RadioButton rdl ;
rdl = (RadioButton)PHEmailfmt.FindControl("rd1") as RadioButton;
if (rdl != null)
{
if (rdl.Checked)
{
Response.Write("rd1 is checked");
}
}
rdl = (RadioButton)PHEmailfmt.FindControl("rd2") as RadioButton;
if (rdl != null)
{
if (rdl.Checked)
{
Response.Write("rd2 is checked");
}
}
rdl = (RadioButton)PHEmailfmt.FindControl("rd3") as RadioButton;
if (rdl != null)
{
if (rdl.Checked)
{
Response.Write("rd3 is checked");
}
}
}
but the find control returns null so can anyone help me plz...
i have created 3 dynamic radio buttons as rd1,rd2,rd3
and on the click of the save button i have the following..
K.Gayathri
|
|
|
|
|
at first, i don't know why you don't use an
<asp:RadioButtonList> it will give you what you want exactly with less effort
if it is:
it would be like that:
<asp:RadioButtonList ID="_radioButtonList" runat="server">
<asp:ListItem Text="text1" />
<asp:ListItem Text="text2" />
</asp:RadioButtonList>
you can create items in it dynamically like this:
ListItem item = new ListItem("Text");
_radioButtonList.Items.Add(item);
and to get SelectedItem , its Text or Value just do like that:
ListItem item=_radioButtonList.SelectedItem;
string selectedItemText=_radioButtonList.SelectedItem.Text;
string selectedItemValue=_radioButtonList.SelectedValue;
you can take SelectedValue in the Save Button Click
Sincerely,
Ibrahim Hebish | SharePoint Software Developer |GlobeSoft(Comp)| EX:EgyptNetwork(Comp)
M: +201281744594
Email: Pronto.cs@gmail.com
|
|
|
|
|
Hi All,
I have a main report with selection formula
i.e if i select employee it will show all the details of employee
later i added subreport with leave information
My requirement is ..
if the user select the employee it should pass the employee name to the subreport stored procedure(c#) as parameter
Please help me with this
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
modified 14-Dec-11 6:41am.
|
|
|
|
|
have a gridview on my webpage that binds from an excel sheet using OleDb
Now I'm trying to set it up so that people can search just by typing a word in the textbox, and then after button click, it'd filter all the results that have the same word in any column
I was advised to use this code:
<pre lang="c#">
protected void Button1_Click(object sender, EventArgs e)
{
string search = TextBox1.Text;
OleDbConnection conn = new OleDbConnection(strConn);
conn.Open();
OleDbCommand cmd = new OleDbCommand("SELECT * FROM [Sheet1$]", conn);
OleDbDataAdapter da = new OleDbDataAdapter();
da.SelectCommand = cmd;
DataTable dt = new DataTable();
da.Fill(dt);
grvCarProof.DataSource = dt.Select("CP number = ");
grvCarProof.DataBind();
}
</pre>
what I can't figure out is what kind of writing should go in my SelectCommand(). Am I even doing it right?
Any advice you can give me would be greatly appreciated. Thanks in advance.
|
|
|
|
|
Hi,
I am using just the following piece of code which assigns to an Entity Framework entity.
if (subordinateValueType.TaskTypeId > 0)
{
TaskTypeController taskTypeController = new TaskTypeController();
subordinateValueTypeEntity.TaskType = taskTypeController.GetEntity(subordinateValueType
.TaskTypeId, context, LoadType.Simple);
}
But I am getting the below exception. Can anybody please help me to get rid of the exception. Thanks in advance.
[System.InvalidOperationException] = {"A referential integrity constraint violation occurred: A primary key property that is a part of referential integrity constraint cannot be changed when the dependent object is Unchanged unless it is being set to the association's principal object
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
hi
I want to add a control like textbox when I click a button and new textbox added to the page but when i click the buttom just create one textbox and I lose previus text box
please help me what I shoud do .
|
|
|
|
|
You need to think about the sequence of events (Where and how do you create/recreate the controls) and using ViewState to preserve the control through PostBacks. Found this in under 30 seconds: ow to add and persist controls dynamically[^].
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
mark merrens wrote: Found this in under 30 seconds:
isn't google awesome??
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|
|
Dear all,
I have the following configuration for my sessionState:
<sessionState mode="InProc" cookieless="UseCookies" timeout="10" >>
It works fine, but there is one thing i don't understand.
When i open multiple tabs, all tabs have the same SessionID, but they don't time out at same time.
I thought that all tabs share the same session, so they have to have also the same timeout
What i want is that ofter session timeout occurs, to logout the user from all opened tabs at the same time.
But in my situaion, when two tabs are open, the first one logs the user out, but not from the second tab. On the second tab, the user still can work.
This is my code to logout and redirect the user ofter session timeout:
protected void Session_Start(object sender, EventArgs e)
{
if (Context.Session != null)
{
if (Context.Session.IsNewSession)
{
string sCookieHeader = Request.Headers["Cookie"];
if ((null != sCookieHeader) && (sCookieHeader.IndexOf("ASP.NET_SessionId") >= 0))
{
FormsAuthentication.SignOut();
HttpContextBase httpContext = new HttpContextWrapper(HttpContext.Current);
UrlHelper urlHelper = new UrlHelper(new RequestContext(httpContext, new RouteData()));
string redirectUrl = urlHelper.Action("LogOn", "Account");
httpContext.Response.Redirect(redirectUrl);
}
}
}
}
How can i solve this issue?
Thanks in advance.
|
|
|
|
|
Does this help?[^]
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
I want to upload image and immediate open it without database connection in asp.net c# programme?
|
|
|
|
|
|
hi
when click on edit button,I allow to update 2 columns.I want cell text of these colums should be null means user insert a new value.
how it is possible?
I used on editing event
protected void jgjgj(object sender, GridViewEditEventArgs e)
{
int index = e.NewEditIndex;
GridViewRow row=GridView4.Rows[index];
row.Cells[4].Text = "";
row.Cells[5].Text = "";
this.Modalpopupextender1.Show();
}
but it is not working.
|
|
|
|
|
Once you assign new edit index, you have to bind the grid again. then later access the controls and assign the values to that. check this..
GridView4.EditIndex = e.NewEditIndex;
GridView4.Datasource = yourDataSource;
GridView4.DataBind();
GridViewRow row = GridView4.Rows[4];
TextBox txt = (TextBox)(row.FindControl("TextBoxID"));
txt.Text="";
txt = (TextBox)(row.FindControl("TextBoxID2"));
txt.Text="";
with regards
Karthik Harve
|
|
|
|
|
I do not have textbox control.where to find TextBoxID?
|
|
|
|
|
Try to this one:
GridView4.EditIndex = e.NewEditIndex;
string str = GridView4.DataKeys[e.NewEditIndex].Value.ToString();
GridViewRow row = (GridViewRow)grvCompType.Rows[e.NewEditIndex];
row.Cells[1].Text = "";
|
|
|
|
|
this is same as my efforts.see question again.
|
|
|
|