|
Well, that sort of helps... But the users for the ASP page each have their own Windows account, and based on those accounts, I need to restrict access to some parts of the SQL Server (Select only in some cases, Select, Insert, Delete, Update in others.) Is there no way to pass the individual's Windows credentials through to the SQL Server through the ASP Page?
|
|
|
|
|
That is true that each user has their own Windows account, but for the connection to sql server it uses the app pools identity. I would restrict access to things like insert update and delete in the UI based off authenticating the user. I don't think you want to wait until the user trys to insert a record and then pass back a sql server error. The user should never be able to do the insert to begin with.
Using the app pool's identity for sql access makes it easier to manage as well. You only have to worry about giving one network user rights to stored procedures etc. Did I mention all sql access from a web service should probably be through stored procedures?
Now I would say do not try to manage the web sites sql access with your windows authentcated users, but if you still want to go down that route you can, even though I think it is a bad idea. There is an identity impersonate available in the web.config file, but that means you must use windows authentication and most likely your web app is on your local intranet.
Ben
|
|
|
|
|
Well, the app is only being used internaly, on our network, which is the reason for using Windows Authentication. It's never being published to the internet. I'm still thinking the ideal way to do this is going to be through SQL Permissions, though I will also be handling security on the IIS server as well. One page in particular has the ability to update and delete items from a table, but I only want select users to actually be able to do that.
So, that being said, how do I go about implementing identity impersonation? I know, it's a newbie question... But I'm still getting started with ASP stuff, coming from Windows programming.
|
|
|
|
|
Hello!
I'm using ASP.NET to send a response to a browser where I want to show an Excel document. This works fine but I have a problem. It only opens the workbook not Excel. I want to see the excel application with a toolbar so it will be possible for the user to save the document.
Here is my code..
Response.ContentType = "application/vnd.ms-excel";
byte[] buffer = new Byte[4096];
while( fileStream.Read(buffer, 0, 4096)>0 )
{
Response.BinaryWrite( buffer);
}
fileStream.Close();
Response.End();
Thanks for any help...
|
|
|
|
|
In classic ASP I successfully used:
Response.AddHeader "Content-Disposition", "attachment; filename=Report_" & Session("REPORTCOUNT") & ".xls"
Response.ContentType = "application/vnd.ms-excel" The content-disposition thing tells the browser to download the file as an attachment.
Hope that helps.
Andy
|
|
|
|
|
I have an asp table to which i add textboxes and values to those textboxes dynamically in the code behind. The user can edit the values in those textboxes and those are updated in the database correspondingly. Now my problem is that i have a dropdownlist in the same page and on selected index change of this i have to repopulate the asptable once again in the same manner- dynamic textboxes and values.Once i do this, the asp table is holding the same old values that were there inspite of filling the table newly. How can i solve this problem??I have not set any viewstate to true here.plz help. Its urgent!
thanks in advance
|
|
|
|
|
Use query string to get textbox values as the page is getting post back after drop down selected index changed so best way is use state management
you can use Session,query string , viewstate etc
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
i have to make multilingual pages in asp.net.i made one pg in english and then copied its resource file to make another resource file for urdu.in the Initilize culture method it gives me this exception:
System.NotSupportedException: Culture 'ur' is a neutral culture. It cannot be used in formatting and parsing and therefore cannot be set as the thread's current culture
'ur' is for urdu
Any suggestions / ideas would be greatly appreciated.
bia ali
-- modified at 2:28 Saturday 31st March, 2007
bia ali
|
|
|
|
|
Hi All,
In which situation we use 2 databases for single Application?
Can u give me realtime Example?
Thanks
|
|
|
|
|
I currently have an application that uses 4 databases and three sql servers. The first database is a great plains database. This is where the order starts. The second database is for the web UI which is where the can add products to the order. The third database is where the web order is set for producing the product. The fourth database is used on site where the product is produced at the plant.
We need all four database to separate logical processes. The initial order entry database is in micro soft great plains, so there isn't much we can do about that one. The second database issolates our web UI. The third contains all the data needed to produce the product. The four runs on site to help track what has been produced and where it is at in production.
Hope that helps.
Ben
|
|
|
|
|
good afternoon!
In a project of online shopping where number of sellers have there shops, developed in asp.net & c#.
I'm storing shopid in a session on one page and this shopid is then used to display related information of the shop .
For ex, on pressing "sold products" button we will get sold products of related shop.
Problem is that ,
If I opened one shop1 then went to another shop say shop2, now currently I have shopid of shop2 in session .
Now when we navigate to the previous page of the flow using browser's back button and click on the link "Sold product" I dont get sold products of shop1 but shop2. It means I'm getting information related to seesion value
currently in session.
Hope you might have got the problemm.Please guide.
Is there any way to obtain value of session variable from history??like that...
Thanks a lot!
yog
hui gfgh kgdgrt njjn hjgkn
|
|
|
|
|
Try with CrossPage Posting. for help Get it[^]
Regards,
Satips.
|
|
|
|
|
I am developing ASP.NET application .
I used nested datagrid.In this,I need to apply validator for each row.
But each validator of each row should not be applicable for other row.
Swapnil Bhavsar
-- modified at 7:34 Friday 30th March, 2007
|
|
|
|
|
Aoa..
I am creating popup window for searching employee record ....the senerio are as follow
Main form name (Visitor's Information) in which i select employee through popup window...but when i search employee in popup window i want to return specific search employee to my main form(Visitor's form)....i successfully created search form but not able to retrieve employeeid from my popup window to my main form.... i have an employeeid in my textbox
Regards,
Haseeb
|
|
|
|
|
using window.ReturnValue to get the employeeID
<< >>
|
|
|
|
|
i m using ASP.NET(2.0)...please give me the complete set of code/example in which i have to see completely....because as i m a new developer in ASP.NET
Regards,
Haseeb.
|
|
|
|
|
|
I Intend o build a Customized Control in Anthem in C Sharp, The control should have the feature that it should be just take table name and populate the record subsequently from the database.
Kindly can anyone guide me from where to start.
Ali
|
|
|
|
|
how to start building a customized Control ?
|
|
|
|
|
In gridview I have 3columns.. DoctorId,name and VisitDate.. I am binding data from database. but during runtime I don't want to diaply doctorid.
for this I have put code in pageload event like this:
GVDoctorActivity.Columns[0].Visible = false; ok. its fine. when I am trying to get the doctorid of selected row it is showing null.. when I put Visible= True am getting the value. I have written code in GridviewSElectedrowchanged event..
<asp:GridView ID="GVDoctorActivity" runat="server" AutoGenerateColumns="False" DataKeyNames="DoctorActivityId"
DataSourceID="DoctorActivityDataSource" SkinID="GridView"
EnableViewState="False" OnSelectedIndexChanged="GVDoctorActivity_SelectedIndexChanged"
<Columns>
<asp:BoundField DataField="DoctorId" HeaderText="DoctorId" SortExpression="DoctorId" />
<asp:BoundField DataField="DoctorName" HeaderText="Doctor Name" SortExpression="DoctorName" />
<asp:BoundField DataField="VisitDate" HeaderText="Visit Date" SortExpression="VisitDate" />
protected void GVDoctorActivity_SelectedIndexChanged(object sender, EventArgs e)
{
string strCampaign;
string DoctorId;
LinkButton LbtCampaign;
int rowIndex = GVDoctorActivity.SelectedIndex;
DoctorId =Convert.ToInt32(GVDoctorActivity.SelectedRow.Cells[0].Text); // getting null here if DoctorId visible is false..
LbtCampaign = (LinkButton)(GVDoctorActivity.SelectedRow.Cells[4].FindControl("lbtnCampaign"));
strCampaign = LbtCampaign.Text;
}
help me..
Thanks.
|
|
|
|
|
u have this..
irkahc wrote: <asp:gridview id="GVDoctorActivity" runat="server" autogeneratecolumns="False" datakeynames="DoctorActivityId"
="" datasourceid="DoctorActivityDataSource" skinid="GridView" enableviewstate="False" onselectedindexchanged="GVDoctorActivity_SelectedIndexChanged" <columns="">
<asp:boundfield datafield="DoctorId" headertext="DoctorId" sortexpression="DoctorId">
<asp:boundfield datafield="DoctorName" headertext="Doctor Name" sortexpression="DoctorName">
<asp:boundfield datafield="VisitDate" headertext="Visit Date" sortexpression="VisitDate">
in datakey u can bind doctorID and then when retreiving data
GVDoctorActivity.Datakeys(Seletedrow.index).value.tostring; to get ID.
Thanks,
Sun Rays
|
|
|
|
|
but the datakey is DoctorAcitvityId not DoctorId... I want to get non datakey name values and those are not visible in Gridview..
<asp:GridView ID="GVDoctorActivity" runat="server" AutoGenerateColumns="False" DataKeyNames="DoctorActivityId"
DataSourceID="DoctorActivityDataSource" SkinID="GridView" Font-Size="10pt" Width="920px"
EnableViewState="False" OnRowCommand="GVDoctorActivity_RowCommand">
|
|
|
|
|
irkahc wrote: GVDoctorActivity.Columns[0].Visible = false;
if it's working fine then after binding data to grid u can make it false.
Thanks,
Sun Rays
|
|
|
|
|
Pls see the code:
Page_Load()
{
GVDoctorActivity.Columns[0].Visible = false; //DoctorId
}
protected void GVDoctorActivity_RowCommand(object sender, GridViewCommandEventArgs e)
{
int DoctorID;
DoctorID = Convert.ToInt32(GVDoctorActivity.SelectedRow.Cells[0].Text); // throwing exception here.bcoz it is returning null value..
}
|
|
|
|
|
Yes correct. now working..I gave that after binding. Thank you verymuch Sun Rays..
|
|
|
|