|
Use AJAX UpdatePanel control.
Put all the code that is being postback to the server in side the UpdatePanel control
|
|
|
|
|
Your going to have to use Javascript, and create your sort of fake grid, and update that fake grid in the DOM. At the same time the item is added, you need to use a web service to update the cart with that item. So when you do a postback, all the items can repopulate that same space.
fahad.1 wrote: .It should happen without postback
Update panels do a partial postback of the page, but it's still a postback.
The only way to get around a postback is to use a web service in the background, in combination with Javascript, to just keep manipulating the dom, until you leave the page.
As far as manipulating the Gridview in JavaScript, I have no idea how.
That's alot of work for that feature or confirmation.
|
|
|
|
|
I am using dropdownlist in c# asp.net. Here one dropdown list getting data's from database and its having required field validator also.,
My ASP design coding is.,
<asp:dropdownlist id="zonename" runat="server" width="195px" tooltip="Select Zone">
<asp:requiredfieldvalidator id="RequiredFieldValidator1" runat="server" controltovalidate="zonename" errormessage="Zone Name Required" initialvalue="Select Zone">
And MY C# coding is....,
da = new MySqlDataAdapter("select name from zone", mysqlcon);
dt = new DataTable();
da.Fill(dt);
zonename.Items.Clear();
zonename.Items.Add("Select Zone");
for (int i = 0; i <= dt.Rows.Count - 1; i++)
{
zonename.Items.Add(dt.Rows[i]["name"].ToString());
}
mysqlcon.Close();
WHEN I AM SAVING THIS DROPDOWNLIST TEXT TO THE DATABASE.,THE WORD "Select Zone" ONLY GOING TO THE DATABASE.
MY INSERT QUERY IS.,
"insert into TABLENAME(zonename) values('"+zonename.text+"')";
Here i couldnt understand what is going on.,i need to save the selected text to the database. If anybody know how to solve this problem, Please let me know.,
Thanks.,
|
|
|
|
|
zonename looks like it is some sort of list so it is unlikely to have a member called text . It would also help if you formatted your code and put <pre> tags around it, to make it more readable thus:
da = new MySqlDataAdapter("select name from zone", mysqlcon);
dt = new DataTable();
da.Fill(dt);
zonename.Items.Clear();
zonename.Items.Add("Select Zone");
for (int i = 0; i <= dt.Rows.Count - 1; i++)
{
zonename.Items.Add(dt.Rows[i]["name"].ToString());
}
mysqlcon.Close();
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Look at the SelectedText and SelectedValue properties of the DropDownList control.
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
|
it's
ddl.items.clear();
ddl.items.add(new listitem("Select a Zone", "--")
ddl.items.add(new listitem(Name, Value));
'Check that the selection is not "--" or > 0
string pvalue = ddl.selectedvalue;
insert into table pvalue
and get the selected value of the ddl, not the selected text
|
|
|
|
|
Hi everyone
Please find below the exact code you need in order to prevent cache from being stored. I am posting this in order to help everyone that ever needs it as I spent myself some hours this last saturday trying to do it. I saw many combinations from the same code everywhere in several forums but this is the only one that worked for me comes, as referenced below
After filling a form, then going back to the previous page and then forward back again, the form is empty as expected. Nothing is stored in the browser's cache
Hope it helps
Regards
Diego Sendra
e-mail: contact@diegosendra.com
http://www.diegosendra.com
[code]
<%
Response.buffer=true
Response.Expires = -1
Response.ExpiresAbsolute = Now() -1
Response.AddHeader "pragma", "no-store"
Response.AddHeader "cache-control","no-store, no-cache,
must-revalidate"
%>
[/code]
|
|
|
|
|
dawnofdefiance wrote: Please find below the exact code you need in order to prevent cache from being stored. Thanks
Alas, it'll be hard to find on the forum, as new messages keep coming in. You might want to submit it as a trick; makes it a bit easier to find.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hi, I posted it as an article instead, as suggested
Thank you
Diego
|
|
|
|
|
hi Eddie
I report a totally unrespectful behavoir from two members of this site, Guirec Le Bars and Sandeep Mewara
After following your advise to posting it as a trick I received this from these users:
Guirec Le Bars: "Not an article and not even a tip I guess..."
Sandeep Mewara: "Agree. Not even a tip."
Inmediatly the article was deleted
I am not used to this kind of treatment, I am a respected professional with over 20 years experience in the field
I just re-submitted it and I HOPE it gets published now
I have the right to judge myself if what I write is of any help or not, and not be judged by third parties
After all, I am helping others, not trying to earn a cent from this or anything else
|
|
|
|
|
diegosendra wrote: I report a totally unrespectful behavoir from two members of this site, Guirec Le Bars and Sandeep Mewara
After following your advise to posting it as a trick I received this from these users:
Guirec Le Bars: "Not an article and not even a tip I guess..."
Sandeep Mewara: "Agree. Not even a tip."
Inmediatly the article was deleted
The word "article" implies a longer text with explanation, while a "tip/trick" entry is usually a short description of a solution. Both are available under the same link. This way, the articles all meet certain minimal quality-criteria. A tip/trick would also need some background on why you wrote it, and what problem it solves.
diegosendra wrote: I just re-submitted it and I HOPE it gets published now
I have the right to judge myself if what I write is of any help or not, and not be judged by third parties
After all, I am helping others, not trying to earn a cent from this or anything else
Aah, all registered users have the option to vote on an article, or on tips. If you meet a lot resistance, it might be better to give it a rest for a moment - it's no fun if you get a lot of hard words for one's work. Still, if you ask Sandeep how it should be formatted/worded before it's approved as a "trick" would probably give you a list of tips on the subject.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hi,
I have developed an application using DOTNET and Oracle 11g, The application while performing load test it throws an error as seen below
"Message: Exception Message : ORA-12542: TNS:address already in use Exception : at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure)
at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src)at Oracle.DataAccess.Client.OracleConnection.Open()
"
The same code works well in regulat cases and breaks only during load testing when the users are 100+ accessing at the same time..Any suggestions are appreciated.
Thanks & Regards,
John
|
|
|
|
|
I want to add dynamic image button on site without ID of Image button so I am using ASP tag to generate dynamic controls with ParseControl method, It's working but event is not fired when click on Image Button
Default.aspx.cs Code
protected void Page_Load(object sender, EventArgs e)
{
string str = @"<asp:ImageButton runat=server ImageUrl=""~/close-icon (1).png"" OnClick=""click"" />";
Control c = Page.ParseControl(str);
form1.Controls.Add(c);
}
protected void click(object sender, ImageClickEventArgs e)
{
Response.Write("Image Clicl");
}
Default.aspx Code
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
<!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>
</div>
</form>
</body>
</html>
Please help me to solve my problem by giving code in solution.
|
|
|
|
|
you need to add command event handler for this:
try this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class dynamicimage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string str = @"<asp:ImageButton ID=""dynoimage"" ImageUrl=""~/images/about01.jpg"" runat=""server"" oncommand=""clickme"" commandname=""btn"" />";
Control c = ParseControl(str);
form1.Controls.Add(c);
((ImageButton)Page.FindControl("dynoimage")).Command += new CommandEventHandler(clickme);
}
protected void clickme(object sender,CommandEventArgs e)
{
Response.Write("Image clicked");
Label1.Text = "Image clicked";
}
}
and here is the aspx page:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="dynamicimage.aspx.cs" Inherits="dynamicimage" %>
<!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></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
<p>
<asp:Label ID="Label1" runat="server" Text="before click"></asp:Label>
</p>
</form>
</body>
</html>
|
|
|
|
|
hey Thnx Ashish Raj Srivastava, It's working properly
|
|
|
|
|
Hi,
I am using 51degrees to redirect to mobile but when I go to the home page www.JassimRahma.com[^] it's not redirecting to my mobile page at http://m.JassimRahma.com[^] and I am not getting any error. I tried it using my Samsung S2 and S3 and Opera Emulator.
here is my web.config:
<sectionGroup name="fiftyOne">
<section name="log" type="FiftyOne.Foundation.Mobile.Configuration.LogSection, FiftyOne.Foundation" requirePermission="false" allowDefinition="Everywhere" restartOnExternalChanges="false" allowExeDefinition="MachineToApplication"/>
<section name="redirect" type="FiftyOne.Foundation.Mobile.Configuration.RedirectSection, FiftyOne.Foundation" requirePermission="false" allowDefinition="Everywhere" restartOnExternalChanges="false" allowExeDefinition="MachineToApplication"/>
<section name="detection" type="FiftyOne.Foundation.Mobile.Detection.Configuration.DetectionSection, FiftyOne.Foundation" requirePermission="false" allowDefinition="Everywhere" restartOnExternalChanges="false" allowExeDefinition="MachineToApplication"/>
</sectionGroup>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Detector.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
<fiftyOne>
<redirect firstRequestOnly="false" mobileHomePageUrl="http://m.jassimrahma.com/" timeout="20" devicesFile="~/App_Data/Devices.dat" mobilePagesRegex="mobile">
</redirect>
<log logFile="~/App_Data/Log.txt" logLevel="Info"/>
</fiftyOne>
|
|
|
|
|
I am using this code to determine if the device is mobile:
<asp:TableRow>
<asp:TableCell VerticalAlign="Top">is Mobile</asp:TableCell>
<asp:TableCell VerticalAlign="Top">:</asp:TableCell>
<asp:TableCell VerticalAlign="Top"><% Response.Write(Request.Browser.IsMobileDevice); %></asp:TableCell>
</asp:TableRow>
but I always get IsMobile = False when using my Samsung Galaxy SII or S3!
why is that? can you try it here from mobile and let me know if you'll get IsMobile = True?
|
|
|
|
|
|
Those don't work very good,
Like is robot, the searchbot detector.
I think it's uses a formula to determine the device or to detect a bot. But over time, things change, and it's hard to keep that up to date.
So figure out a different way to do it.
Looks like you may half to start collecting user agent values, and do a compare or regex against them.
Here's something
ASP.NET Mobile Device Detection[^]
|
|
|
|
|
Hi,
I am Creating a WCF Workflow Service application in .net 4.0 that doing addition,subtraction,multiplication,division.And I am having Normal ASP.Net Web Application that having two textboxes for inputs and a dropdown for Arithmetic[add,sub,mul,div] and a Button for Submit and a label for Output Result.
I dont know how to use or Configure the WCF Workflow Service to the Web Application and get the result.
Pls help me.
Thanks in Advance.
Prasyee
|
|
|
|
|
Hi,
I would like to know how can I make my site automatically create and update the sitemap.xml file? and is it better to update it for search engine optimization?
|
|
|
|
|
|
Hi,
I have the following SPF record in my host:
v=spf1 a mx -all
but reading this it recommends to have the SPF record like this:
v=spf1 mx include:mydomain.com –all
what's your advise?
|
|
|
|
|
|
-all
means that if none of the rules are ok, don't accept the email.
This will mess up your ability to send mail to all domains.
~all
means that if none of the rules are ok, do a soft error
@ 86400 IN TXT "v=spf1 ip4:192.1468.1.1/24 ~mx ~a ~all"
Means any server in the ip range of 192.168.1.1 to 192.168.1.254 can send mail, softerror if no mx record of mail server, softerror of no A PTR, softerror for all other.
If you have a small block of public ip's, then you need to use a caluclator to figure out the subnet.
taking the time to write your SPF file will tighten up your mail security, maybe reduce spam or impersonators.
just remember "-" is reject, "~" is softerror
[edit]
This is a better reference to how it works, than the other above
[how to write an SPF record^]
|
|
|
|
|