|
Hi Guys
I have a web app which is using windows authentication. In this app I have a report viewer control.
My problem is that when tested on my development machine, it works fine, but I get authentication errors when I try to view the reports on the app on the server.
I think this is because the report viewer control is trying to view the SSRS report using the servers credentials rather than the users windows credentials.
Does anybody know how I can pass the user credentials to the control to avoid the error?
(I don't want to use <identity impersonate="true" /> as not everyone should be able to view all reports)
Thank you,
oooo, the Jedi's will feel this one....
|
|
|
|
|
Hi,
I am opening an aspx page using the following code.From that aspx page,i will return some value using Response.Write("hi"); function.I want to get this string.How to get it from the aspx page to VC++.
CInternetSession objInetSession;
char szURL[100];
CStdioFile* objStdFile;
try
{
wsprintf(szURL,"%s","http://101.8.0.24/test/test.aspx");
objStdFile = objInetSession.OpenURL(szURL,1,INTERNET_FLAG_TRANSFER_ASCII ,NULL,0);
}
catch(CInternetException* exp)
{
exp->ReportError(MB_OK,0);
}
Thanks,
|
|
|
|
|
if you're starting up a web app project now, would you bother with ASP.Net or do with MVC?
thx
----------------------------------------------------------
Lorem ipsum dolor sit amet.
|
|
|
|
|
If you are a beginner then start with asp.net else with MVC
|
|
|
|
|
it depends upon your requirement of the client..!
If you want to start with MVC ,you have to complete it.Why to start without knowing that architecture.IMO start with Asp.net.
If you are trying to do an application for practice you can try with MVC.
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
I agree with Gaurav Point.If you are new, start with ASP.NET else if you have good exposure with ASP.NET, you can go for MVC.
There is also a great comparison, have a look
|
|
|
|
|
I have created a custom user control using Visual Studio 2008. The user enters data in three TextBoxes. The data is added in a DataTable which is bound to a ListBox. The user has the option of deleting items from the ListBox.
The ListBox is declared as follows:
asp:ListBox ID="lstNames" runat="server" Height="99px" Width="245px"
EnableViewState="True"
onselectedindexchanged="lstNames_OnSelectedIndex"></asp:ListBox
Inside the function Page_Load I have the following"
if (!Page.IsPostBack)
{
...
lstNames.DataSource = table;
lstNames.DataTextField = "Display";
lstNames.DataBind();
...
}
I also have two buttons which allow me to add user input from TextBox controls to the ListBox and delete items.
My question is:
When I select an item and try to delete it, the SelecteIndex becomes 0 during the postback and the first item is removed (not the one I select). Basically, the SelectedIndex does not persist during a postback. I have looked at different postings here and other sites as well, searched MSDN but I cannot figure out the answer. Is there a way to overcome this problem and how?
Thanks!
Time is the fire in which we burn.
|
|
|
|
|
Probably because you're messing with the listitem collection within the dropdown, you do that, it'll get confused because as far as it's concerned, it's a new datasource and therefore there's no selected. How are you marking which one is deleted in your codebehind?
I'd probably create a seperate object to hold the data, use that as datasource for your dropdown and rebind each time otherwise there'll be a greater chance for state issues.
|
|
|
|
|
Thank you! That's interesting. Could you please elaborate a little bit?
I rebind the datasource every time the page is loaded. Are you saying that this is considered as messing with the listitem collection?
The code I use to delete the item is very simple (obviously I am trying to mark the item but I cannot):
int iIndex = lstNames.SelectedIndex;
if (iIndex > -1)
{
lstNames.Items.RemoveAt(iIndex);
table.Rows.RemoveAt(iIndex);
}
Every time I change the selection, I would like to retrieve the selected index. I cannot because during postback it is set to 0. I have tried to save the view state, but that did not work either. My problem is that I cannot get the selected index at any time at all. If at any point I could retrieve its value, I can store it somewhere. The problem is that I am reading 0 at all times. I don't know what to do.
Time is the fire in which we burn.
|
|
|
|
|
Odd, I've used that code similarly myself and it's been fine unless the dropdown was added dynamically.
Do you lose the selectedindex value if you remove the IsPostback check?
|
|
|
|
|
I lose the selectedIndex the moment I have some action that does a postback. I have tried to capture it in may places, during Page_Init, LoadViewState, SaveViewState, with the IsPostBack, and without it, etc. For the past two days, I have had no success.
...a little bit later...
I am starting to believe that it is a data binding issue. You were absolutely correct. When I remove the databinding code, everything works fine. I need to figure out why.
Time is the fire in which we burn.
modified on Thursday, April 8, 2010 2:42 PM
|
|
|
|
|
Hi,
are you sure, you dont rebind the datasource at any place on postbacks? I mean, obviously your items
still appear in your listbox after postback, you would have mentioned it otherwise.
So your control gets these items either from viewstate or by rebinding the datasource. If you rebind it
on postback, the selectedindex is lost, but the items would still appear. I would suspect that in the first place,
but in your code, i can see the "if (!ispostback...)" part.
Hmm. Maybe you rebind it in some event?
Good luck, these things can really make one scream.
|
|
|
|
|
Thank you! You are absolutely correct (yes, I rebind the datasource). I was seriously about to lose my mind. It never occured to me that that could be an issue.
Time is the fire in which we burn.
|
|
|
|
|
Hi,
I want to upload multiple image files from within an InsertItemTemplate within
a FormView. That Formview is placed in an UpdatePanel. I searched the net for
2 days to find answers to my problem. I am aware that a full postback is required
to make the asp.net FileUpload control work and that a PostBackTrigger has to be set
inside the UpdatePanel. My problem is that the PostBackTrigger button that I place in
the Triggers section of the UpdatePanel can not be found since it is declared in the
InsertItemTemplate. Can this be solved some way. I have read that in this case it is
better to use an AJAX AsyncFileUpload control, but I can not find any examples where
multiple files can be uploaded. I doubt that this is the best way to solve my problem
since the upload starts immediately after a file on the local file system is selected.
I want to start the upload only when the Insert Button inside the InsertItemTemplate is
clicked and therefore do the handling in the ItemInserting event of the FormView.
Can anyone please point me to an example where this is done. I can not imagine I am the
only one having this problem.
tia
|
|
|
|
|
I come from China, the English not very good, but I have an example, I use e-mail sent to you, this example can run, you can serve as a reference. Please tell me your email address.
|
|
|
|
|
|
Email: paperke67@hotmail.com
tia
|
|
|
|
|
People hardly have time to read your whole story. Please be precise what exactly you need.
If you need multiple file upload control, follow the link:
Multiple File Upload User Control[^]
|
|
|
|
|
Hello ,
I want to block some IP number to access my site
In IIS6 I know but in IIS7 I am unable to find option to block
the IP
Thnks.
|
|
|
|
|
In IIS7, for it a role has to be added. Go to Server Manager > Roles > Add Role Services. Under Security node in the Role Services tree there is an option for IP and Domain Restrictions.
|
|
|
|
|
Hi,
optional you can build a ASP.NET HTTP-Module to have your very own, custom made IP filtering.
When in trouble,
when in doubt,
run in circles,
scream and shout
|
|
|
|
|
Yes, we can have our custom module to implement any specific requirement.For normal scenario we can use the one, that is already provided
|
|
|
|
|
|
Hi guys, I have a tiny misunderstanding in implementing my session timeout.
I have a asp.net solution with three pages, Default.aspx, Logout.aspx, and Home.aspx, ofcourse all these share the same web.config file.
In my web.config I have:
<pre>
<!--this is my logout implementation-->
<authentication mode="Forms">
<forms loginUrl ="Default.aspx" timeout ="1" requireSSL="false" path="/" defaultUrl="Default.aspx"
slidingExpiration="true"/>
</authentication>
<authorization>
<deny users="?" />
</authorization>
</pre>
and
<pre>
<location path="Home.aspx">
<system.web>
<authorization>
<allow users ="?"/>
</authorization>
</system.web>
</location>
</pre>
but only the Default.aspx is timing out and refreshes. But I want that to happen in the Home.aspx, when no activity is received it must redirect to the Default.aspx.
I know I am messing up somewhere, can anybody help me please???
Thanks
M
|
|
|
|
|