|
I don't think there is an easy way to do this, when you have databases which are quite big and are spread out throughout your system it will make the app run slightly slower.
You will have to load all controls on the page for the first time anyway and the server request has to happen.
Maybe look at trimming down your app in other ways e.g. if you have images reduce the size, try and move any of your databases closer together on the system or shrink down if possible.
hope any of that helps!
|
|
|
|
|
Stubborn as I am, I found a solution. If you want to try it I will give you a brief description of the setup.
I have an UpdatePanel with the slow-loading content. Set Visible = false on the slow-loading content and make sure that it's not visible and that page is loading fast. If you have trouble making the content invisible, or if it consists of several components, put the content on a Panel and make the Panel invisible.
Add a second UpdatePanel with an AJAX timer. Set Interval = 1 on the timer. Add a Tick event handler to the timer that sets the Interval to a higher value or disable the timer all together if you don't want to update the content regularly. Also make the slow-loading content visible.
Your page will load and will immediately trigger an update which will force the slow-loading content to load asynchronously.
|
|
|
|
|
glad you found a solution i will remember that
|
|
|
|
|
Hi All
i am having a tough time running my web app after obfuscation.
I tried one tool called dotfuscator, shipped with VS2005,I was able to obfuscate the .net dlls but I failed to run the application after Obfuscation.
I don’t know whether I am making any mistake while obfuscating code.
my application is a multilayered architecture i.e. there are actually 5 projects in one application. i guess this could be a reason that my app is not running after obfustion.
please give me some idea how do i successfuly obfuscate and run my application,
Thanks.
|
|
|
|
|
did you find any solution for this? Because wanted to obfuscate my web app too, as the app will be deployed on client server. Please let me know if you've found any solution.
Thanks
|
|
|
|
|
hey friends i m using asp.net with C#
i have problem with generating new row in Gridview without refereshing page
can anyone guide with an example code
have a nice time....
Thanking you all
|
|
|
|
|
Assume you are binding the gridview using a DataTable . When the button is clicked, add a new row to this DataTable instance and re-bind with the gridview. Use AJAX toolkit's update panel control, put the grid view and button inside UpdataPanel .
|
|
|
|
|
hey navneeth
thanks for that answer.
but i m not using update panel for it.
i want to do using script manager. if u can help me then just tell me.
can u plz provide an example
thanks
|
|
|
|
|
What is the issue in using UpdatePanel ? If you say you are using ScriptManager, then your project is AJAX enabled. So you can use UpdataPanel without any issues, isn't it ?
|
|
|
|
|
hi
this is my code and i m here at my compny restrict to use update panel.
so now suggest me how to solve it
thanks
This is my Aspx page
]]>
<title>Untitled Page
function ShowSaveButton()
{
var divNormStyle = document.getElementById("divNormal").style;
var divPopStyle = document.getElementById("divPopulate").style;
divNormStyle.visibility = 'hidden';
divNormStyle.display = 'none';
divPopStyle.visibility = 'visible';
divPopStyle.display = 'block';
}
function HideSaveButton()
{
var divNormStyle = document.getElementById("divNormal").style;
var divPopStyle = document.getElementById("divPopulate").style;
divPopStyle.visibility = 'hidden';
divPopStyle.display = 'none';
divNormStyle.visibility = 'visible';
divNormStyle.display = 'block';
}
<asp:button id="btnPopulateGrid" runat="server">
Text="PopulateGrid"
ValidationGroup="vgNumberOfRows" OnClick="btnPopulateGrid_Click" />
|
<asp:button id="btnSaveGrid" runat="server">
Text="Save Grid" OnClick="btnSaveGrid_Click" />
|
| <asp:gridview id="gvwDynamicRows" runat="server">
AutoGenerateColumns="false"
Width="100%">
<columns> <asp:templatefield>
<headertemplate>
<asp:label id="lblimg" runat="server">
Text=" ">
<itemtemplate>
<asp:imagebutton id="btnPopulateGrid" runat="server">
ImageUrl="add.gif" ToolTip="Add Row" OnClick="btnPopulateGrid_Click"/>
<asp:templatefield>
<headertemplate>
<asp:label id="Label1" runat="server">
Text="Name">
<itemtemplate>
<asp:textbox id="TextBox1" runat="server">
Text='<%# Eval("Name")%>'
Width ="100px">
<asp:templatefield>
<headertemplate>
<asp:label id="Label2" runat="server">
Text="ContactNo">
<itemtemplate>
<asp:textbox id="TextBox2" runat="server">
Text='<%# Eval("contactNo")%>'
Width ="100px">
<asp:templatefield>
<headertemplate>
<asp:label id="Label3" runat="server">
Text="Email">
<itemtemplate>
<asp:textbox id="TextBox3" runat="server">
Text='<%# Eval("email")%>'
Width ="100px">
<asp:templatefield>
<headertemplate>
<asp:label id="Label4" runat="server">
Text="Designation">
<itemtemplate>
<asp:textbox id="TextBox4" runat="server">
Text='<%# Eval("designation")%>'
Width ="100px">
|
<asp:validationsummary id="vsNumberOfRows" runat="server">
ShowMessageBox="true"
ShowSummary="false"
ValidationGroup="vgNumberOfRows"/>
This is aspx.cs page
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using MySql.Data.MySqlClient;
public partial class _Default : System.Web.UI.Page
{
private DataTable dt;
DataRow dr;
string cScript;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
dt = CreateDataTable();
Session["dtadd"] = dt;
btnPopulateGrid_Click(this.GetType(), null);
}
}
protected void btnPopulateGrid_Click(object sender, EventArgs e)
{
dt = (DataTable)Session["dtadd"];
dr = dt.NewRow();
dt.Rows.Add(dr);
gvwDynamicRows.DataSource = dt;
gvwDynamicRows.DataBind();
cScript = "ShowSaveButton();";
ClientScript.RegisterStartupScript(typeof(Page), "clientscript", cScript);
Session["dtadd"] = dt;
}
protected DataTable CreateDataTable()
{
DataTable dtValues = new DataTable();
dtValues.Columns.Add(" ");
dtValues.Columns.Add("Name");
dtValues.Columns.Add("contactNo");
dtValues.Columns.Add("email");
dtValues.Columns.Add("designation");
return dtValues;
}
protected void btnSaveGrid_Click(object sender, EventArgs e)
{
string cmdText;
foreach (GridViewRow gdr in gvwDynamicRows.Rows)
{
string name = ((TextBox)gdr.FindControl("TextBox1")).Text;
string contactNo = ((TextBox)gdr.FindControl("TextBox2")).Text;
string email = ((TextBox)gdr.FindControl("TextBox3")).Text;
string designation = ((TextBox)gdr.FindControl("TextBox4")).Text;
string mycon = "Database=tsmdemo;Server=192.168.2.22;uid=root;pwd=tops123;";
using (MySqlConnection connection = new MySqlConnection(mycon))
{
connection.Open();
cmdText = "INSERT INTO tblempinfo VALUES ('"
+ name + "','" + contactNo + "','" + email + "','" + designation + "')";
MySqlCommand cmd = new MySqlCommand(cmdText, connection);
cmd.ExecuteNonQuery();
}
}
gvwDynamicRows.DataBind();
cScript = "HideSaveButton();";
ClientScript.RegisterStartupScript(typeof(Page), "clientscript", cScript);
}
}
|
|
|
|
|
Hi,
I am using SQLDatasource to fill the grid. Table that is use to display in grid not having primary key. Now I want to delete the records without using RowDeleting Option. Because table does not contains primary key.
So What Should I do ?
Thanks
|
|
|
|
|
I would try and put a primary key on the table, if this is not possible create a stored procedure where you pass through the information to enable you to find the row you wish to delete.
i.e Table with two columns Description, IPAddress
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
Create PROCEDURE Canteen_DeleteLocation
-- Add the parameters for the stored procedure here
@Description varchar(20),
@IPAddress varchar(15)
AS
BEGIN
DELETE FROM [Canteen_Location]
WHERE Description = @Description And IPAddress = @IPAddress
END
GO
Then you just need to setup the datasource delete parameter to call this SP and ensure your fields are databound.
Hope this helps?
Tom
|
|
|
|
|
Its usually good practice to have a primary key for your tables, I would def put one in
|
|
|
|
|
Hi
I have created a website which has a number of buttons on it which allow users to add items to there basket, they then click on an AJAX watermarked textbox to set focus before using a keyboard wedge scanner to scan there staff ID card, this causes a postback and validates the user - all works perfectly. - This is all done on a touch screen with a keyboard wedge scanner, the users will have no access to a keyboard.
My problem is caused if the user attempts to scan their card before clicking on the watermarked textbox. This then forces a postback to the server and will fire one of the button controls at random (I presume it fires a control which it thinks has got the focus.)
I have tried setting focus to a textbox automatically following a button control being fired this would then ensure that the wrong button is not fire if the user accidentally scans before they set focus of the control. however the cursor only appears in the text box on original page load and not after the control has been updated.
textbox1.focus
updatepanel2.focus
Any body got any suggestions on this???? Is there a way that I can tell how the postback has been fired and therefore being able to trap it? The barcode value is 'pu00000343'
Thanks
Tom
|
|
|
|
|
Hi, i have one grid view which having one template column. In that item template contains linkbutton and edit template contains fileupload control.
When i am adding new row to gridview, the fileupload control will appear and i will upload the file. Up to this its working fine. But when i am in edit mode, i want to display the file name in fileupload control. But being its read only property, its not showing the filename in upload control and when it is submitting, the null value is entering in database.?
How can i show the filename or filepath in fileupload control, when gridview is in edit mode.
G. Satish
|
|
|
|
|
Satish - Developer wrote: fileupload control, when gridview is in edit mode.
Fileupload control don't have any constraints with gridview. It will be rendered as HTML upload control which don't allow to set the file path through code.
|
|
|
|
|
Some nasty javascript might do the trick. Use Attributes.Add("value", yourUrlString) in your codebehind.
I did this once for a password field:
txtPassword.Attributes.Add("value", readUserDetail["password"].ToString());
|
|
|
|
|
Hi,
I have a web service client app and I am trying to monitor the soap
traffic to and from my service with a tool called SoapUI.
The tool allows me too either create a TCP tunnel or a HTTP proxy.
So I am not sure which one I should use.
If we use the tunnel it has the web service url and a port to assign values
which I have done. https://www.mydomain.com/myservice.asmx port 8089.
But now how do I point my webservice client proxy to the SoapUI tunnel.
I tried this
https://localhost/myservice.asmx:8089
Does not work i get Connection was interrupted error.
Malcolm
|
|
|
|
|
I have a asp gridview named "gridview1" with three columns. The first column is
named "description" , second column "price", and the third "quantity". I
have added a template column to the gridview1 named "Total" and placed a text
box named "RowTotal" in the column.
Question-
How can I have the gridview multiply "price" by "quantity" and place the
result in the textbox "RowTotal" when the user selects the quantity amount
they want in the "quantity" column?
Thanks in advance for the help
|
|
|
|
|
In Quantity Column whether you having textbox or dropdownlist control.
|
|
|
|
|
And also tell the name of the primary key of your table,so that it will be helpful for us
|
|
|
|
|
In the OnRowDataBound eventhandler of a gridview you can check the values for price and quantity. Multiply them and show the value in your TextBox-object.
There are numerous examples to be found via codeproject.com or google.
|
|
|
|
|
Hi,
One way to do this by making all the columns in the grid as template columns.
then in the RowDataBound event using FindControl() method, set the value for Total label.
<br />
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem )<br />
{<br />
decimal Price = Convert.ToDecimal ( ((Label)e.Item.FindControl("PriceLabel")).Text );<br />
decimal Quantity = Convert.ToDecimal ( ((Label)e.Item.FindControl("QuantityLabel")).Text );<br />
Label TotalLabel = ((Label)e.Item.FindControl("TotalLabel"));<br />
TotalLabel.Text = Convert.ToString ( Price * Quantity);<br />
}<br />
<br />
Where did error begin?
-- Naison Garvasis Pekkattil
|
|
|
|
|
Could you help me with a VB example? The "Price" column is a money type in the database and the "Quantity" column is an int type in the database. Here is the code.
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs)
Dim TotalLabel As String
Dim Quantity As String
Dim Price As String
If e.Row.RowType = ListItemType.Item Or e.Row.RowType = ListItemType.AlternatingItem Then
End If
Decimal Price = Convert.ToDecimal ( ((Items)e.Item.FindControl("PriceLabel")).Text );
Decimal Quantity = Convert.ToDecimal ( ((Items)e.Item.FindControl("Quantity")).Text );
Decimal TotalLabel = ((Items)e.Item.FindControl("TotalLabel"));
TotalLabel = Convert.ToString(Price * Quantity)
End Sub
Thank you
|
|
|
|
|
Hi again...
I just wanna adjust location of a control like textbox whatever located on asp.net page and i wanna make it by using c# code at code-behind...
thanks in advance...
I am not a perfect programmer,but i have perfect's programmers' habits.
|
|
|
|