|
|
|
Instead of directly making the file available for download, create a page (it could be aspx or ashx) which accepts paramters to identify the file.
You can then log the download and then use Response.TransmitFile() to transfer the file to the user. You'll probably also need to specify the response headers to describe the correct file type (MIME type) to the browser.
|
|
|
|
|
|
Use the "content-disposition" header to set the filename of the response.
C#:
Response.AddHeader("content-disposition", "filename=file.mp3");
|
|
|
|
|
My application needs a row header so that i can select a row fully and a column header to select column fully....
I implemented these but looks like something else...
please help.....I am new to asp .net .....
The code is as follows
<asp:gridview id="GridView1" runat="server" allowpaging="True" allowsorting="True" width="300px"><br />
HeaderStyle-BackColor="AliceBlue" CellPadding="4" ForeColor="#333333" GridLines="Both"><br />
<footerstyle backcolor="#507CD1" font-bold="True" forecolor="White" /><br />
<rowstyle backcolor="#EFF3FB" /><br />
<editrowstyle backcolor="#2461BF" /><br />
<selectedrowstyle backcolor="#D1DDF1" font-bold="True" forecolor="#333333" /><br />
<pagerstyle backcolor="#2461BF" forecolor="White" horizontalalign="Center" /><br />
<headerstyle backcolor="#507CD1" font-bold="True" forecolor="White" /><br />
<alternatingrowstyle backcolor="White" /><br />
</asp:gridview>
SAJAN A PILLAI
ASP.NET,C#.NET Programmer
dWise Solutions and Services Pvt Ltd.
BANGALORE
"Winners don't do different things. They do things differently. ...
|
|
|
|
|
Hi guys. I used AspNetSqlMembershipProvider to create the membership system for one of my sites. It isn't working consistently. I'd like to change some of the settings I originally chose in my web.config. I'm worried that if I do this it will screw up the accounts that have already been created. I need advice about the best way to go about this.
Currently, I have this:
<membership defaultProvider="AspNetSqlMembershipProvider" userIsOnlineTimeWindow="15">
<providers>
<remove name="AspNetSqlMembershipProvider" />
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="LocalSqlServer"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
applicationName="/"
requiresUniqueEmail="true"
passwordFormat="Hashed"
minRequiredNonalphanumericCharacters="0"
maxInvalidPasswordAttempts="4"
passwordAttemptWindow="10" />
</providers>
</membership>
I'd like to change it to this:
<membership defaultProvider="AspNetSqlMembershipProvider" userIsOnlineTimeWindow="15">
<providers>
<remove name="AspNetSqlMembershipProvider" />
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="LocalSqlServer"
enablePasswordRetrieval="true"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
applicationName="/"
requiresUniqueEmail="true"
passwordFormat="Clear"
minRequiredNonalphanumericCharacters="0"
maxInvalidPasswordAttempts="4"
passwordAttemptWindow="10" />
</providers>
</membership>
I'm worried that changing from hashed passwords to clear passwords and getting rid of require question and answer now that 100 or so users have already signed up will hose all the previous accounts and make it impossible for them to log in.
The reason I'm doing this is that users are complaining about intermittent problems with my CreateAccount, RecoverPassword, and ChangePassword controls, which are set up with default controls. I haven't done anything fancy that should screw them up. I feel like the most exotic part is the portion of the web.config I shared with you. I feel like if I make that less complicated it might solve all my problems. But I'm scared it will screw up existing accounts.
Thoughts? Ideas?
Thanks!
|
|
|
|
|
I'm sure there must be a way of doing this through code rather then editing the xml file, trying searching the web for c# code to update membership login
|
|
|
|
|
I'd be willing to do that if there is an advantage. But if it's all the same, I'd much rather edit a configuration file than write code.
|
|
|
|
|
Turns out, the CSS Friendly Adapters are incompatible with the Membership system. I didn't have to remove the adapters completely, I just turned them off on the relevant three pages. Now it seems to work.
Thanks!
|
|
|
|
|
Is there a tutorial that explains how to create an editing section for a database item that is connected through a inbetween table. For example, in my case I'm making a simple user address database, and I have the one table with the user's information, then there is another table with the office location, and then there is a 'inbetween' table that ties these two together through primary keys. Is there a tutorial on this site that shows how to do this using Visual Studio 2005? I have it somewhat working but I can figure out how to create an Insert to add another location for a user, or edit the current one without inserting a null into the database.
Am I making sense? Any help is appreciated.
|
|
|
|
|
You talking about a lookup table?if so there are plently of exmpales out there especially on microsoft msdn
|
|
|
|
|
hai,
i m now working in ASP.NET with C# web application(.net 2003, 1.1 framework) and sql server 2000.
i m having a sql table with two fields Roll_number and name.
the roll number is auto generated by MY PROGRAM.
when user fill the name and click OK button, the record is saved in database.
this application is accessed by 1000's of users.
Here the Roll_number is getting Replica.
How to avoid this. i want to LOCK the roll_number which is generated by MY PROGRAM.
if other users try to attempt, it should give the next number.
The main aim of my process is to AVOID DUPLICATION in my database (since roll_number is primary key and
i cant generate auto number in my database). Help me! - KARAN
|
|
|
|
|
Use a stored proc to get the highest roll number then add 1
SELECT max(roll_number) FROM table
only two letters away from being an asset
|
|
|
|
|
Thanks for your reply Mark Nischalke, the same i performed.Even though when more than 1000 users accessing, the MAX value is getting repeated. (while 2 user attempt same time, the MAX value is supplied to them and when they updating REPLICA occuring)..... and also i like to handle this with my coding itself. Kindly help me.............
modified on Friday, March 14, 2008 9:35 AM
|
|
|
|
|
Just curious, why can't you use autonumber?
Assign the number when inserting the record using the same technique
only two letters away from being an asset
|
|
|
|
|
Thanks for your reply. I cant generate AUTO ID since, i just want to show the ID in text box and this auto number is mixed with some characters (eg.. "ROLL100", "ROLL101", "ROLL102" etc...) so i programmatically generate the number starting from 100(and i store this 100 in separate database table(say.."A") and find the MAX and generate the next ROll number) and add the "ROLL" as prefix and display in the user text box. After user finish all other process he save this(so, in a separate database table(say.."B") the id=ROLL100,name=KARAN etc etc will be saved).So the "A" table is only used to generate the ID and the "B" table consist of all informations. This is my full process. And in both the "A" and "B" table, i m getting replication.how to proceed this and avoid replication.? Help me plz.... - KARAN
|
|
|
|
|
I believe you are making it more difficult than it really is. Just because you want to append text to your ID doesn't preclude you from using an autonumber column.
INSERT INTO A
RETURN scope_identity()
Or just eliminate table A, you can append whatever text to the ID after it is retrieved.
only two letters away from being an asset
|
|
|
|
|
Thanks my friend. whats the major problem is here they save the information year wise. (i.e, year 2007 consist of 100 records(from ROLL100 to ROLL200 AND the year 2008 consist of the same 100 records from ROLL100 to ROLL200). so i had my table as.....
<u><b>number year</b></u>
100 2007
101 2007
100 2008
101 2008
and i will populate the year wise storing the exact storing mechanism of Roll number in master table is ("ROLL100/2007").Is there any process in which i want to LOCK this value "ROLL100" or locking the "100" numeric, so that no other should get this value and after the completion of this process, then only the next user should proceed. OR, values should placed in QUEUE status and checked... <i>some ideas like this... i like to do it programmatically plz.. </i>HELp me.. thanks in advance..... KARAN
modified on Friday, March 14, 2008 10:29 AM
|
|
|
|
|
That is the problem with some questions here, not giving all the information at first.
First it was an autonumber problem, then adding text, now we have years and a set range.
Use a singleton object to access the database and assign numbers. Unless there are still more requirements that you have yet devulge.
only two letters away from being an asset
|
|
|
|
|
FontStyle fontStyle;
fontStyle = FontStyle.Bold;
fontStyle = FontStyle.Italic;
How i give both Bold & Italic as a FontStyle
Best Regards,
Trishul Tandel
Software Developer
|
|
|
|
|
Following will work.
FontStyle fs = FontStyle.Bold | FontStyle.Italic;
|
|
|
|
|
Thanks
Best Regards,
Trishul Tandel
Software Developer
|
|
|
|
|
how can i find code for online examination using asp.net.
please send me the code or related topics
|
|
|
|
|
For those new to message boards please try to follow a few simple rules when posting your question.
1. Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
2. Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
3. Keep the subject line brief, but descriptive. eg "File Serialization problem"
4. Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
5. If you are posting source code with your question, place it inside
tags, or click the "Ignore HTML tags in this message" check box.
6. Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
7. Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
8. Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
9. If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
10. No advertising or soliciting.
11. We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
“The woods are lovely, dark and deep. But I have promises to keep, and miles to go before I sleep.”
|
|
|
|