|
.NET- India wrote: And also, how can i convert my .aspx page into html page for improving the speed
Who told you this?
.NET- India wrote: But my question is is it okay to have a single page and bringing the data dynamically or should i take different different pages(15 pagges) according cities name. And also i've to make my site considering SEO(search engine optimization). So which way i should go through.
Create a single page to retrieve and display the data according to cities.
You may later use URL rewriting to make the pages look like they are different pages. It will also help the search engines to consider them seperately.
Hope this helps.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
i searched in the net to get a help for this , but didn't ge ta proper answer, do any one know how to catch the event of browser closing , or any idea to handle this situation--> abandon the session when browser closed
|
|
|
|
|
The window.onbeforeunload event will catch it. But this event will also be fired if you postback the web page. Therefore you cannot differentiate whether the browser is closed or the web page is submitted using this event.
|
|
|
|
|
|
As i said in my answer, the onunload and onbeforeunload will be fired whenever the browser is closed or the web page is submitted to the server. Therefore you cannot differentiate between these two events. Therefore it is not advisable to handle this event.
|
|
|
|
|
tanks for both of u , is there any other option to address this issue.
|
|
|
|
|
Hi Prasadbuddhika,.. this is a property of session that session will automatically expire with browser close. Means if u close any browser window, all session will automatically expire.
Regards...
Vijay Jain
"One thing you can't recycle is wasted time."
|
|
|
|
|
on the submit of the form,i want to search the data given in the textbox control in google.com.
now, i want the result page for the data given in the textbox
truphis
|
|
|
|
|
Why is teh subject Screen Scrapping thn?
codesairam wrote: now, i want the result page for the data given in the textbox
Which result page are you talking about?
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Why do you want to scrap .. ? try this code. Is this do you want to do exactly
<form method="get" action="http://www.google.com/search">
<input type="text" name="q" size="31"
maxlength="255" value="" />
<input type="submit" value="Google Search" />
</form>
|
|
|
|
|
HI, i have one data table with all data. Now i want to create a new table in sqlserver and export this data to sqlserver table. How can we achieve this without using loop in data table. Is there any direct method ?
or any alternative to do this ? I would appreiciate your help.
G. Satish
|
|
|
|
|
|
Hi
I am trying to implement OpenId and facebook connect login for our site. I found there RPX API which supports login from variuos providers. I found only uservoice.com which implemented with RPX API, my question is whether do we get password to store in our database for next time login if the user wants to use our site login form.
Any ideas please!!!!!!!!
--
http://ashakthi.blogspot.com
http://kids-articles.blogspot.com
|
|
|
|
|
Hello,
Good question. With RPX, relying party sites that have enabled third party logins do not store a user password. The user is redirected back to his/her preferred identity provider's site to authenticate, and while a rich set of profile data can be passed back to a relying party site with that user's consent, the password stays with the provider.
This enhances the overall security of OpenID as a technology and as a standard, since a user's password must no longer be exposed out in the wild on sites with potentially unencrypted user databases.
For return logins, RPX stores a cookie to remember a user's preferred provider, and displays that provider's button as the primary option to sign-in. This makes the return visit sign-in process as easy as a single click.
For more information on RPX, you can check out our technical documentation at http://rpxnow.com/docs, visit our developer wiki at http://rpxwiki.com or email us at supportATrpxnowDOTcom.
One more thing - a relying party site also has the option of prompting users to create a username/password when signing-in with a third party account for the first time, as a backup if necessary.
modified on Wednesday, May 27, 2009 12:12 AM
|
|
|
|
|
retrive data from sql database to a gridview, then how to use search option in a gridview ?
|
|
|
|
|
use this code it will help u
private DataTable GetRecords()
{
conn.ConnectionString = "User ID=sa;Data Source=(local);Database=inventry";
//SqlConnection conn = new SqlConnection(strConnection);
conn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "Select ptype,pqty from total_stock";
SqlDataAdapter dAdapter = new SqlDataAdapter();
dAdapter.SelectCommand = cmd;
DataSet objDs = new DataSet();
dAdapter.Fill(objDs);
return objDs.Tables[0];
}
private void BindGrid()
{
DataTable dt = GetRecords();
if (dt.Rows.Count > 0)
{
grdSearch.DataSource = dt;
grdSearch.DataBind();
}
}
private void SearchText()
{
DataTable dt = GetRecords();
DataView dv = new DataView(dt);
string SearchExpression = null;
if (!String.IsNullOrEmpty(txtSearch.Text))
{
SearchExpression = string.Format("{0} '%{1}%'",
grdSearch.SortExpression, txtSearch.Text);
}
dv.RowFilter = "ptype like" + SearchExpression;
grdSearch.DataSource = dv;
grdSearch.DataBind();
}
public string Highlight(string InputTxt)
{
string Search_Str = txtSearch.Text.ToString();
// Setup the regular expression and add the Or operator.
Regex RegExp = new Regex(Search_Str.Replace(" ", "|").Trim(),
RegexOptions.IgnoreCase);
// Highlight keywords by calling the
//delegate each time a keyword is found
return RegExp.Replace(InputTxt, new MatchEvaluator(ReplaceKeyWords));
// Set the RegExp to null.
RegExp = null;
}
public string ReplaceKeyWords(Match m)
{
return "<span class=highlight>" + m.Value + "</span>";
}
protected void txtSearch_TextChanged(object sender, EventArgs e)
{
SearchText();
}
|
|
|
|
|
DataTable dt = GetYourDataTable(); //Write code to get data from your database.
DataView dv = new DataView(dt);
dv.RowFilter = ""City = 'New York'"; //Write your filter condition
GridView1.DataSource = dv;
GridView1.DataBind();
|
|
|
|
|
|
i want to convert sql data to Text.txt Format , How it Posible?
|
|
|
|
|
First, this question is not related to asp.net.
If you want to convert SQL Server data into text format, you can use export/import feature available in the SQL Server Management Studio.
|
|
|
|
|
Hi all!!!
I have a problem wich conversion format DateTime.
I create AjaxCalendar UserControl, an use it in my page, and I have a conversion format DateTime:
<br />
protected void AjaxCalendar_DataBinding(object sender, EventArgs e) {<br />
try {<br />
DateTime time = DateTime.Parse(TextDate.Text, new CultureInfo("en-GB"));<br />
}<br />
catch (Exception) {<br />
TextDate.Text = string.Empty;<br />
return;<br />
}<br />
}<br />
and asp code of User Control:
<asp:TextBox ID="TextDate" runat="server" Width="70px" />
<Ajax:CalendarExtender ID="AjaxCalendar" runat="server" TargetControlID="TextDate" Format="dd/MM/yyyy" OnLoad="AjaxCalendar_DataBinding"/>
I load from database and add to database datatime from this control. When I use Visual Studio (I use Visual Studio 2008) this conversion work fine, but when i put my project page on IIS or on Server this conversion not work, and i obtain "String.Empty".
If I block this code I obtain data in format MM/dd/yyyy. In Regional Options i have selected format English and stat United Kingdom.
I write implicit conversion in this Mode ...ToString("dd/MM/yyyy") looks fine, but when i wont to add data in database with datetime i obtain error on dateTime.
Help me, PLEASE to create a conversion function or else, for work in IIS, or on Server.
|
|
|
|
|
hi
i m using asp.net with c# and trying to edit gridview but it's give error
Must declare the variable '@pname'.
my code is
<asp:SqlDataSource ID="SqlDataSource1" Runat="server" ConnectionString="<%$ ConnectionStrings:mcplconnectionstring2 %>"
UpdateCommand="UPDATE [mat_in] SET [pname] = @pname, [qty] = @qty, [sno_to] = @sno_to,[sno_from]=@sno_from WHERE [materialrecipt_no] = @materialrecipt_no"
SelectCommand="SELECT [materialrecipt_no],[pname],[qty],[sno_to],[sno_from] FROM [mat_in]">
<UpdateParameters>
<asp:Parameter Type="string" Name="ProductName"></asp:Parameter>
<asp:Parameter Type="Decimal" Name="Quantity"></asp:Parameter>
<asp:Parameter Type="Decimal" Name="Sr No(Start)"></asp:Parameter>
<asp:Parameter Type="Decimal" Name="Sr No(End)"></asp:Parameter>
</UpdateParameters>
</asp:SqlDataSource>
<asp:GridView ID="GridView1" Runat="server" BorderColor="#3366CC" BorderStyle="None" CellPadding="4" BackColor="White"
BorderWidth="1px" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="materialrecipt_no" DataSourceID="SqlDataSource1">
<FooterStyle ForeColor="#003399" BackColor="#99CCCC"></FooterStyle>
<PagerStyle ForeColor="#003399" HorizontalAlign="Left" BackColor="#99CCCC"></PagerStyle>
<HeaderStyle ForeColor="#CCCCFF" Font-Bold="True" BackColor="#003399"></HeaderStyle>
<Columns>
<asp:CommandField ShowEditButton="True"></asp:CommandField>
<asp:BoundField ReadOnly="True" HeaderText="materialrecipt no" InsertVisible="False" DataField="materialrecipt_no"
SortExpression="materialrecipt_no"></asp:BoundField>
<asp:TemplateField SortExpression="ProductName" HeaderText="Product"><EditItemTemplate>
<asp:DropDownList ID="editProductName" Runat="server" DataSourceID="SqlDataSource1" DataTextField="pname"
DataValueField="pname" Text='<%# Bind("pname") %>'></asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" Runat="server" ErrorMessage="You must provide a Product Name."
ControlToValidate="editProductName">
*</asp:RequiredFieldValidator>
</EditItemTemplate>
<ItemTemplate>
<asp:Label Runat="server" Text='<%# Bind("pname") %>' ID="Label3"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField SortExpression="materialrecipt_no" HeaderText="Sr No"><EditItemTemplate>
<asp:TextBox ID="editUn" Runat="server" Text='<%# Bind("materialrecipt_no") %>' Columns="6">
</asp:TextBox>
</EditItemTemplate>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
<ItemTemplate>
<asp:Label Runat="server" Text='<%# Bind("materialrecipt_no") %>' ID="Label4"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField SortExpression="qty" HeaderText="Quantity"><EditItemTemplate>
<asp:TextBox ID="editUnitPrice" Runat="server" Text='<%# Bind("qty") %>' Columns="6">
</asp:TextBox>
</EditItemTemplate>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
<ItemTemplate>
<asp:Label Runat="server" Text='<%# Bind("qty") %>' ID="Label1"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField SortExpression="srno_to" HeaderText="Sr No(End)"><EditItemTemplate>
<asp:TextBox ID="editUnitsInStock" Runat="server" Text='<%# Bind("sno_to") %>' Columns="4"></asp:TextBox>
<asp:CompareValidator ID="CompareValidator2" Runat="server" ErrorMessage="You must provide a valid integer for Units In Stock."
ControlToValidate="editUnitsInStock" Operator="DataTypeCheck" Type="Integer">
*</asp:CompareValidator>
</EditItemTemplate>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
<ItemTemplate>
<asp:Label Runat="server" Text='<%# Bind("sno_to") %>' ID="Label2"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField SortExpression="srno_from" HeaderText="Sr No(Start)"><EditItemTemplate>
<asp:TextBox ID="editUnitsInsr" Runat="server" Text='<%# Bind("sno_from") %>' Columns="4"></asp:TextBox>
<asp:CompareValidator ID="CompareValidator3" Runat="server" ErrorMessage="You must provide a valid integer for Units In Stock."
ControlToValidate="editUnitsInsr" Operator="DataTypeCheck" Type="Integer">
*</asp:CompareValidator>
</EditItemTemplate>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
<ItemTemplate>
<asp:Label Runat="server" Text='<%# Bind("sno_from") %>' ID="Label3"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<SelectedRowStyle ForeColor="#CCFF99" Font-Bold="True" BackColor="#009999"></SelectedRowStyle>
<RowStyle ForeColor="#003399" BackColor="White"></RowStyle>
</asp:GridView>
pls help me
thanks in advance
|
|
|
|
|
Name of parameter should be "pname" not a "ProductName".
<asp:Parameter Type="string" Name="ProductName"></asp:Parameter>
<asp:Parameter Type="string" Name="pname"></asp:Parameter>
A DATAPOST COMPUTER CENTRE
(K.V Prajapati)
|
|
|
|
|
I have a gridview with autogeneratecolumn false.I have bind it with a data table dt.In dt there is a column named as "status" whose data type i bit.that means status can take either 0 or1.in gridview this column shows true or false.
I want to show "Read" and "Unread" for 0,1 respectively.
How can I do???
plz..help...
|
|
|
|
|
In GridView1_RowDataBound(),
try this,
if (e.Row.Cells[1].Text == "0")
{
e.Row.Cells[1].Text = "Read";
}
|
|
|
|