|
|
Weird, it was actually me (and I take your point above). Click on the v2 link and it shows me as the last editor.
|
|
|
|
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class plrsmkt_calculation : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
int totalrs = 0;
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
totalrs += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "rs"));
}
else if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells[1].Text = "Total";
e.Row.Cells[1].Font.Bold = true;
e.Row.Cells[2].Text = totalrs.ToString();
e.Row.Cells[2].Font.Bold = true;
e.Row.Cells[3].Text = totalrs.ToString();
e.Row.Cells[3].Font.Bold = true;
}
}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
}
}
The above coding display me Total of a column with display of all rows as per database
but now i want to display total of same column(without rows) on other page of my web site. Can u help me
modified 4-Jun-15 13:48pm.
|
|
|
|
|
What total, what footer, what other page? Please edit your question and explain exactly what your issue is.
|
|
|
|
|
|
I have a very very simple asp.net application with a very very simple page on it, the defaul.aspx.
In the page's code behind I have the usual Page_Load handler where I simply ask myself if it is a postback or not ( if (!IsPostBack) {...}).
How is it possible that, without having any controls on the page, I run into the !IsPostBack three times as I simply call the page ? It is like the page is called three times ....
Is there any explaination to this ridiculous behaviour ?
MSDN doesn' t absolutely talk about details of Load event , it just says it is called at a certain point of the "page life cicle" .-...
|
|
|
|
|
Something is requesting your page multiple times. Maybe it's a misunderstanding about master pages? Or update panels? As you haven't posted any code or given any relevant details and we can't access your system I'm not sure how you are expecting someone to help. Use a tool like Fiddler to capture the network traffic and see if that will help you determine where the requests are coming from.
|
|
|
|
|
Since you haven't provided any code, I'll have to take a guess: your event handler is wired up multiple times.
There are several ways event handlers can be wired to events in ASP.NET; if you've used more than one, then the event will be fired multiple times.
- If AutoEventWireup[^] is set to "True", methods with names like
Page_Load will automatically be wired up to the equivalent event. - If you're using VB.NET, adding the
Handles clause to a method will wire it up to the specified event. - If you have an
OnEventName="Handler" attribute in your markup, that method will be wired up to the specified event. - If you have a
default.aspx.designer.cs / default.aspx.designer.vb file in your project, you might find that it contains code to wire up the event handler.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I have a C# ASP Web project where I’m required to produce a 200+ page PDF to eventually download and open on the browser. I have no experience in building a PDF file, and I was wondering if someone could point me in the right direction. I need a component / product / method that would be able to handle such a large report.
Thank you in advance.
|
|
|
|
|
|
Okay, maybe I posed the question incorrectly.
I have researched, and I've even tried a few products, and they're either inefficient or hang when they grow past 5 pages.
I guess if I could rephrase my question, it would be...
What is the most TRIED and efficient PDF printing library which most developers use?
|
|
|
|
|
Actually, the most important aspect to your question is one you haven't addressed, and that is if you are only interested in free components. Most free PDF components are not very good. Also if there are some you have already discounted you should state what they are so people know not to advise things you have already discounted.
|
|
|
|
|
In future please post in one forum only.
|
|
|
|
|
I posted a message in the SQL forum but I think it was the wrong place. This is my problem. When I do an ExecuteNonQuery statement string from a c# client I am adding C# variables to the hard coded ExecuteNonQuery statement from the client as such:
string sqlQuery = "UPDATE rights SET category_key = " + toCat + " WHERE rights_key = @rights_key";
QueryContainer Instance = new QueryContainer(sqlQuery);
ExecuteNonQuery(sqlQuery);
<pre>
Also when I do an SQL ExecuteScaler statement I am using from a C# client I am adding C# variables to the hard coded values in the SQL statement Execute ExecuteScaler client like this:
<pre>
queryString.Append(" SELECT isnull(");
queryString.Append(" (SELECT CASE WHEN convert(smalldatetime, '" + valDateMaterialRequired + "') < (getdate() + isNull(hier_asp_config.late_days_num, 3)) THEN '1' ELSE '0' END");
queryString.Append(" FROM hier_asp_config ");
queryString.Append(" WHERE asp_key = " + aspKey + " )");
queryString.Append(" , CASE WHEN convert(smalldatetime, '" + valDateMaterialRequired + "') < (getdate() + 3) THEN '1' ELSE '0' END)");
return ExecuteScaler(queryString.ToString()).ToString();
<pre>
Now in the Class that calls the actual SQL I am using these techniques:
<pre>
protected int ExecuteNonQuery(string queryString)
{
int returnValue = 0;
if (!_iserror)
{
if (_trace)
DoTrace("TAMIS.Data.Loader.ExecuteNonQuery", queryString);
if (_connection == null || _connection.State == ConnectionState.Closed)
{
OpenConnection();
}
DbCommand command = _provider.CreateCommand();
command.Connection = _connection;
command.CommandText = queryString;
command.CommandType = CommandType.Text;
if (_useTransaction) { command.Transaction = _transaction; }
try
{
returnValue = command.ExecuteNonQuery();
}
catch (Exception e)
{
if (e is EntryPointNotFoundException)
throw e;
RollBack();
LogBLL bll = new LogBLL();
bll.WriteErrorLog(e);
_iserror = true;
}
finally
{
if ((!KeepAlive && _connection.State == ConnectionState.Open) || _iserror == true)
{
CloseConnection();
}
}
}
else
{
returnValue = -1;
}
return returnValue;
}
<pre>
And this:
<pre>
protected object ExecuteScaler(string queryString)
{
object returnValue = null;
if (!_iserror)
{
if (_trace)
{ DoTrace("TAMIS.Data.Loader.ExecuteScalar", queryString); }
if (_connection == null || _connection.State == ConnectionState.Closed)
{
OpenConnection();
}
DbCommand command = _provider.CreateCommand();
command.Connection = _connection;
command.CommandText = queryString;
command.CommandType = CommandType.Text;
if (_useTransaction) { command.Transaction = _transaction; }
try
{
returnValue = command.ExecuteScalar();
}
catch (Exception ex)
{
if (ex is EntryPointNotFoundException)
throw ex;
RollBack();
LogBLL bll = new LogBLL();
bll.WriteErrorLog(ex);
_iserror = true;
}
finally
{
if ((!KeepAlive && _connection.State == ConnectionState.Open) || _iserror == true)
{
CloseConnection();
}
}
}
else
{
returnValue = -1;
}
return returnValue;
}
<pre>
These are clearly giving me SQL injection errors. In my case I cant change the code to stored procedures like they should be so How do I make the C# variable values from my client calling code and still work but not give me SQL injection errors?
|
|
|
|
|
You change it in the same way you would if you were using a stored procedure - by using parameters.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I am creating a basic company website with MVC5 and bootstrap theme.
Requirements for the website are a dynamic side-menu navigation that when clicked will show the appropriate content on body of the website and a blog-like page for news-posts. CRUD operations for menu-content and news-posts will be needed.
Project will be uploaded on Microsoft Azure . My question is what to choose for a cheap database option. Obvious choices are local sql( mdf file) or SQL server on azure but we
want to search the possibility of using azure storage (blob?) but I have no experience with it.
Does the choice of storage(blob) has any advantages over the sql solutions for such a project and what are those in terms of price/performance/ease of implementation ? What do you think it is the best option of those 3 for a small website with mostly text and some images for content with basic dynamic capabilities and small traffic expectations.
If I chose AZURE STORAGE-BLOB just for RnD reasons are there any quick guides on how to implement similar project with azure storage you can recommend ?
Thanks for your help.
|
|
|
|
|
I'm trying to play mp4 video just by starting an appropriate process
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = fullpath;
process.Start();
fullpath is a file path/name on the server.
When I run it while in development mode, it's working fine.
But when upload and run the site from the server, nothing happens. IIS is configure properly, mp4 MIME is there. I don't get any errors, just nothing happens. What could that be? Any ideas?
Regards
|
|
|
|
|
esb77 wrote: fullpath is a file path/name on the server. So you are trying to run it on the server.
|
|
|
|
|
It worked locally because the server where your code was running was also the client, and your code was probably running as the logged in user.
When the web server is remote the process is running on the server so the mp4 is playing on the server, assuming the code is running under an account that has access to the hardware like the speakers. When a tree falls in the woods and no-one is there, does it make a sound? When your code is playing an MP4 on the server and no-one is there to listen to it, is it playing at all? Who knows.
You're not going to get this code to work, if you want to play MP4s on the client you need the code to run on the client. Look into the html5 video element or flash players.
|
|
|
|
|
I have an old application (using ASP.NET 2.0) running well on several IIS version from 6 to 7.5, but have a strange behaviour on 8.0/8.5
The application uses the Microsoft Ajax library on the client side, and the code goes like this:
<html>
<head>
.. all the styles and scripts included here...
</head>
<body>
...the markup of the page goes here...
<script>
Sys.Application.add_load(function (sender, args) {
if (!args.get_isPartialLoad()) {
window.radopen('/Michlol3/GeneralPages/Agreement.aspx?guid=421b25ef-9815-4588-861a-08ecb17f7e5e', 'idAgreementWindow');
}
});
Sys.Application.initialize();
...more in-page script here...
</script>
</body>
<html>
From all IIS versions it looks the same and all content in place, but, when served from IIS 8.0/8.5 (2012 or 2012 R2 server) the window Agreement.aspx never opened...
This code is pure client-side and I can not understand how it related to the IIS version, but the only difference between the two tested environments is the version (of the OS and IIS)...
I'm aware that this is not a good question, and I'm not looking for a direct solution, but more for ideas of what to check more...Of course, if you had the same problem and got any solution - do not hesitate to share ...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
As far as I can see, the .NET 2.0 / 3.5 version of MicrosoftAjax.js is completely broken in Windows 8.1 / Server 2012. The functions registered via add_load or add_init are never called.
The only workaround I've found is to use a version from an older OS, or the Microsoft CDN:
https://ajax.microsoft.com/ajax/3.5/MicrosoftAjax.js[^]
<asp:scriptManager runat="server" ...>
<scripts>
<asp:scriptReference
name="MicrosoftAjax.js"
path="https://ajax.microsoft.com/ajax/3.5/MicrosoftAjax.js"
/>
</scripts>
</asp:scriptManager>
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
You saved the day!!!
I will ask Chris to let upvote an answer a million time...Meanwhile get a 5!!!
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
Hi,
Anybody having idea about video calling and text chat, Kindly share your ideas. Am using mod verto freeswitch webRTC concept.
Regards
Sri
|
|
|
|
|
Try a Google search, you may be pleasantly surprised.
|
|
|
|
|
How to link windows form module within Web application?
If it is possible using Web Services, than how i can use web service?
Pls anyone help me its urgent
|
|
|
|