|
On Button Postback an Aspx Page runs the following onclick C# event handler:
{
..
// dr[“Content”] - DataRow Item type byte[] where is a song in mp3 format
ar = dr[“Content”];
Response.ContentType=“audio/mpeg”;
Response.Clear();
Response.BufferOutput = true;
Response.BinaryWrite(ar);
Response.Flush();
}
I received error in Response.Flush() – The remote host closed the connection.(HttpException).
If I use Response.End() in place of Response.Flush() receive WMPlayer(on the Client) error about there is not codecs for playing sending stream. It possible that sending stream from ASP.Net Page is wrong because on client PC mp3 codecs are installed.
I try to use Response.WriteFile(filename) instead of Response.BinaryWrite(ar) and received the same errors.
Note : I see after Response.BinaryWrite(ar) line , in debugger, Response.OutputStream.Length property is showing a SystemNotSupportedException.
My question:
Can Asp.Net Page send audio to client as other binary content “application/pdf”,”image/gif”, i.e ?
Please help me,
Thanks
|
|
|
|
|
The global.asax file in Web App is:
<%@ Application Language="C#" %>
public void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started
}
public void Session_End(object sender, EventArgs e)
{
// Code that runs when a session ends.
}
and mode attribute is set to InProc for SessionState element in Web.config file, and State Management configuration for Asp.Net Site in IIS 6.0 is mode = IProc and Cookieless mode = UsesCookies. The Client is Internet Explorer 6.0.
The Session_Star fires but Session_End does not. Why?
Help me please,
Thanks
|
|
|
|
|
Session_End will not fire until Session.Abandon is called in your code.
When the user signs out from the website then make a call to Session.Abandon.
|
|
|
|
|
If you don't call Session.Abandon() , then the Session_End event will fire when the session expires. The default session timeout in IIS is 20 minutes. If you didn't set any other expiration in code, than your event will fire after that time.
regards,
Mircea
Many people spend their life going to sleep when they're not sleepy and waking up while they still are.
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
|
hi all
I don't know do it works or not See i want to access the URL's of one website but before going to that url(page) i need to set cookies so that
i can get the valid page i am using HtmlDocumentClass and InternetExplorer class to load the url as i am devloping windows application
|
|
|
|
|
Hi,
Here i am working with this code on Windows XP Professional 2002, with SP2 environment.
Same code is working in one system, and from the other system with the same environment its throwing "The security ID structure is invalid " error message.
Can any one help to resolve this problem.
Here is code...
//////////////////////////Code////////////////
try
{
string path;
//path = String.Empty;
//path = "C:\\SerTest";
path = String.Format("File://{0}", txtFolderPath.Text.ToString());
ADSSECURITYLib.ADsSecurity secUtil = new ADSSECURITYLib.ADsSecurity();
ActiveDs.SecurityDescriptor secDesc = (ActiveDs.SecurityDescriptor)secUtil.GetSecurityDescriptor((object)path);
ActiveDs.AccessControlList acl =(ActiveDs.AccessControlList)secDesc.DiscretionaryAcl;
///new
ActiveDs.AccessControlEntry ace1 = new ActiveDs.AccessControlEntry();
ace1.Trustee = txtUser.Text;
ace1.AccessMask = (int)ActiveDs.ADS_RIGHTS_ENUM.ADS_RIGHT_WRITE_OWNER;
ace1.AceType = (int)ActiveDs.ADS_ACETYPE_ENUM.ADS_ACETYPE_ACCESS_ALLOWED;
ace1.AceFlags = (int)ActiveDs.ADS_ACEFLAG_ENUM.ADS_ACEFLAG_INHERIT_ACE | (int)ActiveDs.ADS_ACEFLAG_ENUM.ADS_ACEFLAG_INHERIT_ONLY_ACE | 1;
acl.AddAce(ace1);
AccessControlEntry objAce2;
objAce2 = new AccessControlEntryClass();
objAce2.Trustee = txtUser.Text;
objAce2.AccessMask = (int)ActiveDs.ADS_RIGHTS_ENUM.ADS_RIGHT_GENERIC_ALL;
objAce2.AceType = (int)ActiveDs.ADS_ACETYPE_ENUM.ADS_ACETYPE_ACCESS_ALLOWED;
objAce2.AceFlags = (int)ActiveDs.ADS_ACEFLAG_ENUM.ADS_ACEFLAG_INHERIT_ACE | 1;
acl.AddAce(objAce2);
///new
secDesc.DiscretionaryAcl = acl;
secUtil.SetSecurityDescriptor(secDesc, path);
}
catch(Exception ex)
{
Response.Write("Error:-" + ex.Message);
}
//////////////////////////code end////////////
Regards
Raghu
Raghu Babu Alluir @ Satyma Computer, Hyderabad
|
|
|
|
|
Hi,
I have a page that displays data in GridView. The data is obtained from an SQL Server database. One column is an IP addresses, which are stored as VarChar(15) in the database.
The page executes a select statemnet and bind the GridView with the DataTable obtained by executing this SQL statement.
The problem is that I want to allow the user to sort the Grid according to the IPs column.
Taking into consideration, that IP
10.5.0.0 should come before 10.30.0.0 in ascending sorting. So, I can't rely on the built in sorting of the GridView.
Kind regards,
Ahmed
|
|
|
|
|
You can always create a computed column that brings the numerical value of the ipaddress then override the SortCommand and specify the computed column as the sort expression
|
|
|
|
|
I was looking forward for something like the Sort function of the System.Array class, to which I can pass a class implementing IComparer. It seems there is no other way than that indianet had posted.
Thanks indianet for your help.
|
|
|
|
|
i have made an http handler, in web.config i have gievn the path of the page for which this particular httphandler will be invoked, now the problem is that the controls present on that particular pages are not visible, before implementing this HTTP Handler for this particlur page the controls were visible ,can any one let me know the solution of this problem ASAP.
|
|
|
|
|
i have made an http handler, in web.config i have gievn the path of the page for which this particular httphandler will be invoked, now the problem is that the controls present on that particular pages are not visible, before implementing this HTTP Handler for this particlur page the controls were visible ,can any one let me know the solution of this problem ASAP.
|
|
|
|
|
Post the code for your http handler
|
|
|
|
|
using System;
using System.Web;
using System.IO;
namespace testhandlers
{
///
/// Summary description for Class1.
///
public class MyHttpHandler : IHttpHandler
{
// Override the ProcessRequest method.
public void ProcessRequest(HttpContext context)
{
HttpFileCollection file = context.Request.Files;
int MaxFileSize = 2* 1024 * 1024;
for(int i =0;i<file.count;i++)
{
="" file="" tempfile="new" file();
=""
="" int="" filesize="file[i].ContentLength;
" if(filesize="" *="" 1024="" *1024=""> MaxFileSize)
{
context.Response.Redirec"ErrorForm.aspx");
}
}
}
// Override the IsReusable property.
public bool IsReusable
{
get { return true; }
}
}//class
}/NameSpace
|
|
|
|
|
Hello,
how do I validate and debit a credit card? Are there any (web)services for that? I just need a starting point here. Just in case it is important: A German company providing the service would be an advantage!
Thanks in advance!
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
You need to go through a payment gateway and pass the credit card information to the gateway, and you will get back the authentication confirmation or rejection.
But first you will need to obtained a merchant account from a bank (which deals with CC) or a credit card processing centre. It is subjected to be approved or disapproved by the bank or centre (base on your company, risk of your business etc).
|
|
|
|
|
Hi,
I need a control in ASP.Net like Masked Edit Control in VB 6.0. For the validation purpose of Phone numbers i need this control. Can anyone give me suggesstion for this.
Thanks in advance.
Thanks and Regards,
R. Sangeetha Priya.
Prya
|
|
|
|
|
Here's one:
http://www.eworldui.net/CustomControls/MaskedTextBox.aspx
|
|
|
|
|
We know that we can use font/color dialog box for windows applications but is there any thing for ASP.NET 1.1, please show me the way, ASAP
|
|
|
|
|
Hi,
I have a multi user application in ASP.NEt (vb.net). I want to put my print operations in a queue so that i can bulk-print at the end of the day. To be specific i have to retrieve the inner html inside a div tag, and then store it in printing queue( can be SQL database,filesystem,or anywhere else). After searching through several engines, i am left with the option to convert the current page to PDF (using 3rd party components), save it in the file system and then execute print at the end of the day.
Do i have any other option besides converting my page to PDF?
Ritesh
|
|
|
|
|
hi,
I have a text element which needs to be rotated at 90 degrees.
i put the text in a div layer and used the following code to rotate,
oDiv.style.filter='progidXImageTransform.Microsoft.BasicImage(rotation=3)';
This code works fine in IE but i am not able to run it in other browsers.
Can anyone suggest help on this regard
Thanks in advance
Regards
anu
I am using Outlook express to read all the mails in the inbox.How can i know the connecting url of my outlook express.
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
Can some body tell me which all web controls are ajax enabled in framework 1.1?
|
|
|
|
|
None of the native controls that come with .NET 1.1 are ajax ready.
|
|
|
|
|
Hi,
populating a dropdown control with dates.
The length of the control seems to be double the length of the dates.
How can I reduce the size of the control to be as same as the length of the dates please?
This is how the control is popiulated:
foreach(DataRow rowPayDate in dsPayDates.Tables["Table"].Rows)
{ ddlPayDates.Items.Add(DateTime.Parse(rowPayDate["dtPayDate"].ToString()).ToShortDateString().Trim());
}
|
|
|
|