|
Indeed. You can see it this way: rows with status=0 should be displayed in green; rows with Status=1 should be displayed in yellow, and rows with Status=2 should be shown in red.
Dox Girl, where are you?
|
|
|
|
|
Yes, you need to write a bit of code in, probably, the OnItemDataBound event of the grid to assign the appropriate style based on the value.
|
|
|
|
|
i want to send a report via FAX.. can any1 show me the way ?
|
|
|
|
|
This has nothing to do with ASP.NET. there is no fax component built in, you need to buy one.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
i am working on a project where we required recording audio/VOICE from outer source that may be through micro phone to our application.can anybody suggest me about this....if possible please give demo code.
if I have to use any third party tool please suggest me. the below asp.net code working in local system only but i need recorded file is save in webserver(iis).
1. Open C#.net web applications. And added the blow namespace.
using Microsoft.VisualBasic.Devices;
using Microsoft.VisualBasic;
using System.Runtime.InteropServices;
2. Add the below API.
[DllImport("winmm.dll", EntryPoint = "mciSendStringA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
private static extern int mciSendString(string lpstrCommand, string lpstrReturnString, int uReturnLength, int hwndCallback);
3. Create three Buttons and given the below name and text for the buttons.
1. Record
2. SaveStop
3. Read
1. Under Record Button Click paste the below Code:
// record from microphone
mciSendString("open new Type waveaudio Alias recsound", "", 0, 0);
mciSendString("record recsound", "", 0, 0);
2. Under Save / Stop button Click,
// stop and save
mciSendString("save recsound c:\\record.wav", "", 0, 0);
mciSendString("close recsound ", "", 0, 0);
Computer c = new Computer();
c.Audio.Stop();
3. Under Read Button Click
Computer computer = new Computer();
computer.Audio.Play("c:\\record.wav", AudioPlayMode.Background);
Save and Execute it.
thanku&Regards,
Nagarjuna....
|
|
|
|
|
naagrjuna wrote: where we required recording audio/VOICE from outer source that may be through micro phone to our application.can anybody suggest me about this....if possible please give demo code.
It says you have absolutely no idea about how ASP.NET works. ASP.NET can't record voice. Take a book and read to learn what it can do.
|
|
|
|
|
you should tell your client that they are not free to invent any functionality and expect it to be possible and that as you know nothing about ASP.NET, you're not a good person to ask. Then you should read the sticky post at the top of the forum on how to ask questions. 'hai' is not a useful subject line.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I have used an http handler in my website.This works fine on my local PC.But fails to work on IIS.
Can anyone help me solve this issue?
Thanks and Regards
ARINDAM
|
|
|
|
|
Well, you haven't provided any information about the HttpHandler or you IIS settings, version etc. Here is my thoughts
1 - Check the web.config entry.
2 - If HTTPHandler is handling any extensions that is not processed by ASP.NET, make sure the extension is added to the IIS ISAPI extension list.
3 - If in IIS7, you need to do some more changes in the settings. Let me know if you are using IIS7.
|
|
|
|
|
Hi all
Am trying to do the sorting through coding
Protected Sub GridView1_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs) Handles GridView1.Sorting
Dim sortExpression As String = e.SortExpression
If e.SortDirection = SortDirection.Ascending Then
e.SortDirection = SortDirection.Descending
GridView1.Sort(sortExpression, SortDirection.Descending)
Else
e.SortDirection = SortDirection.Ascending
GridView1.Sort(sortExpression, SortDirection.Ascending)
End If
UDF_SetMasterData()
UDF_SetGridData()
end sub
but am getting an error like this:
An unhandled exception of type 'System.StackOverflowException' occurred in System.Web.dll
and if i try to put a break point and check,the loop is continuing within the same Gridview1_sorting..
Anybody knows what acn be the reason?
|
|
|
|
|
your commandline calling GridView.Sort(.....) is the problem. If you would do a debug and would step into this line with F11, then you will notice you have created a recursive call to the method you are in. And then it reaches the point it has too many calls and then your error peeps up.
You shoud create a dataview that holds the sorted data after the users hits its request for a sort on the data.
|
|
|
|
|
ok...den can u tel me how can i do that?...
|
|
|
|
|
If you would take a look at this article: http://www.codeproject.com/KB/grid/GenericGridView.aspx[^]">. You'll see it is not that hard to build.
|
|
|
|
|
Thanks a lot...Now sorting is happening in my gridview..but the problem is if i click on same column second time sorting is not happening...
on the first click it will sort as descending...and again i click on same column it should sort as ascending...but not happening...
but if i click any other column and come back to this its working fine...
what can be the reason?
|
|
|
|
|
Is your value for ascending/descending for the column stored in a session variable?
If not, than do so. When u see the page it is in disconnected state, so the website does not memorize the local variables only the session variables.
good luck
|
|
|
|
|
Sorry i didnt get u....
My code is here
Protected Sub GridView1_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs) Handles GridView1.Sorting
'Retrieve the name of the clicked column (sort expression)
Dim pageindex As Integer
pageindex = GridView1.PageIndex
Dim sortExpression As String = e.SortExpression
'Decide and save the new sort direction
If (sortExpression = e.SortExpression) Then
If gridSortDirection = SortDirection.Ascending Then
gridSortDirection = SortDirection.Descending
Else
gridSortDirection = SortDirection.Ascending
End If
Else
gridSortDirection = WebControls.SortDirection.Ascending
End If
Me.DsRefMaster1.Tables(Me.HdnProcessingTable.Value).DefaultView.Sort = sortExpression
Me.DvProcessing = Me.DsRefMaster1.Tables(Me.HdnProcessingTable.Value).DefaultView
UDF_SetMasterData()
UDF_SetGridData()
GridView1.PageIndex = pageindex
End Sub
Private Property gridSortDirection()
Get
'Initial state is Ascending
If (ViewState("GridSortDirection") Is Nothing) Then
ViewState("GridSortDirection") = SortDirection.Ascending
End If
'Return the state
Return ViewState("GridSortDirection")
End Get
Set(ByVal value)
ViewState("GridSortDirection") = value
End Set
End Property
|
|
|
|
|
Hi,
I am not a VB-code but a CSharpcoder (as a little warning)
You State: If (sortExpression = e.SortExpression) Then
How dus this check your ViewState("GridSortDirection") ?
|
|
|
|
|
I have put that gridSortDirection as private property na...check the second function...
Private Property gridSortDirection()
Get
'Initial state is Ascending
If (ViewState("GridSortDirection") Is Nothing) Then
ViewState("GridSortDirection") = SortDirection.Ascending
End If
'Return the state
Return ViewState("GridSortDirection")
End Get
Set(ByVal value)
ViewState("GridSortDirection") = value
End Set
End Property
|
|
|
|
|
If i click on the second time its giving an Error like this:
Sys.InvalidOperation Exception ScriptLoader.load script cannot be called while the script loader is already loading scrips
|
|
|
|
|
do you use the if Page.IsPostback Then construction?
If that is false only then you should call your property.
This is due to AJAX
also check your code:
If (sortExpression = e.SortExpression) Then
If gridSortDirection = SortDirection.Ascending Then
gridSortDirection = SortDirection.Descending
Else
gridSortDirection = SortDirection.Ascending
End If
Else
gridSortDirection = WebControls.SortDirection.Ascending
End If
what are the values in a debug of:
sortExpression, gridSortExpression
and what path does it run in the if sections?
|
|
|
|
|
this is my design code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login page.aspx.cs" Inherits="Login_page" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<!-- <summary>
||||| Style Sheet |||||
</summary>
--><link title="standard" href="Styles.css" type="text/css" rel="stylesheet">
</head>
<body>
<!-- ||||| Login Form ||||| -->
<form id="frmlogin" method="post" runat="server">
<table id="mainTable" border="0" style="left: 368px; position: relative; top: 177px">
<tr>
<td>
<table class="t_border" id="loginTable" cellspacing="15" cellpadding="0" style="left: -1px; position: relative; top: 12px">
<tr>
<td style="height: 24px"><b>Login: </b>
</td>
<td style="height: 24px"><asp:textbox id="txtUserName" runat="server" width="160px"></asp:textbox></td>
</tr>
<tr>
<td><b style="position: relative">Password: </b>
</td>
<td><asp:textbox id="txtPassword" runat="server" width="160px" textmode="Password"></asp:textbox></td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="height: 21px; position: relative;">
<asp:Label ID="Label3" runat="server" Font-Size="Large" Style="left: 5px; position: relative;
top: -3px" Text="Selcet Center"></asp:Label>
<asp:DropDownList ID="DropDownList1" runat="server" style="left: 6px; position: relative; top: 1px">
<asp:ListItem>Select Type</asp:ListItem>
<asp:ListItem>Service Center</asp:ListItem>
<asp:ListItem>Call Center</asp:ListItem>
</asp:DropDownList></td>
</tr>
<tr>
<td style="height: 21px"><asp:Label ID="Label4" runat="server" Font-Size="Large" Text="Select Zone" style="left: 5px; position: relative; top: 0px" Width="97px"></asp:Label>
<asp:DropDownList ID="DropDownList2" runat="server" Width="111px" style="left: 5px; position: relative; top: -1px">
<asp:ListItem>Select Zone</asp:ListItem>
<asp:ListItem>West Zone</asp:ListItem>
<asp:ListItem>North Zone</asp:ListItem>
<asp:ListItem>South Zone</asp:ListItem>
<asp:ListItem>Other</asp:ListItem>
</asp:DropDownList></td>
</tr>
<tr>
<td align="center" colspan="2"><asp:button id="Button1" runat="server" text="Submit" borderstyle="Solid" OnClick="Button1_Click1"></asp:button></td>
</tr>
</table>
</form>
<asp:label id="lblMessage" runat="server" width="288px" font-bold="True" font-italic="True"
font-size="Medium" forecolor="#C00000" style="left: -2px; position: relative; top: 286px"></asp:label>
<asp:label id="lblMessage2" runat="server" width="288px" font-bold="True" font-italic="True"
font-size="Medium" forecolor="#C00000" style="left: -289px; position: relative; top: 259px"></asp:label>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TOSHIBA1ConnectionString %>"
SelectCommand="SELECT [First_Name], [LOGIN_Id], [Password] FROM [Users]"></asp:SqlDataSource>
<!-- ||||| End of Form ||||| -->
</body>
</html>
i am getting the error in the data base connection it showing that u have not initilize the data base connection
using System;
using System.Data;
using System.Configuration;
using System.Collections;
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 System.Data.SqlClient;
public partial class Login_page : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
#region Web Form Designer generated code
#endregion
protected void Button1_Click1(object sender, EventArgs e)
{
if (Page.IsValid)
{
if (DBConnection(txtUserName.Text, txtPassword.Text))
{
FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, false);
Response.Redirect("wellcome.aspx");
}
else
{
lblMessage.Text = "Invalid Login, please try again!";
}
}
}
private bool DBConnection(string txtUser, string txtPass)
{
SqlConnection myConn = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["<%$ ConnectionStrings:TOSHIBA1ConnectionString %>"]);
SqlCommand myCmd = new SqlCommand("sp_ValidateUser", myConn);
myCmd.CommandType = CommandType.StoredProcedure;
SqlParameter objParam1;
SqlParameter objParam2;
SqlParameter returnParam;
objParam1 = myCmd.Parameters.Add("[LOGIN_Id]", SqlDbType.VarChar);
objParam2 = myCmd.Parameters.Add ("[Password]", SqlDbType.VarChar);
returnParam = myCmd.Parameters.Add("[First_Name]", SqlDbType.VarChar);
objParam1.Direction = ParameterDirection.Input;
objParam2.Direction = ParameterDirection.Input;
returnParam.Direction = ParameterDirection.ReturnValue;
objParam1.Value = txtUser;
objParam2.Value = txtPass;
try
{
if (myConn.State.Equals(ConnectionState.Closed))
{
myConn.Open();
myCmd.ExecuteNonQuery();
}
if ((int)returnParam.Value < 1)
{
lblMessage.Text = "Invalid Login!";
return false;
}
else
{
myConn.Close();
return true;
}
}
catch (Exception ex)
{
lblMessage2.Text = ex + "Error Connecting to the database";
return false;
}
}
}
|
|
|
|
|
What line did you get your error on? Have you got a connection string in the config file?
|
|
|
|
|
Nothing understandable. Please post properly
|
|
|
|
|
Go to your admissions office, hand them back your student ID and tell them you're too stupid to be on this course. Then go home stand in front of a mirror and repeat these lines 100 times "Would you like fries with that, Sir".
|
|
|
|
|
Just to add, it's idiots like you that are killing our industry, especially when you start taking jobs through sites like rentacoder and cause end users to assume that this level of cluelessness is what our industry is about. If this is not homework, but a paid job, then contact the client, tell them you were stealing from them, and return their deposit.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|