.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

how to get ID with protected void

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :ASP.Net

   protected void PotniNalogUredi_Click(object sender, EventArgs e)

        int ID = Convert.ToInt32(PregledNalogovGrid.DataKeys[Convert.ToInt32(e.CommandArgument)].Values[0].ToString());

           Session["ID"] = ID;

This is my current code.

Error in getting ID.
Even if I use this code:
int ID = Convert.ToInt32 (PregledNalogovGrid.DataKeys [row.RowIndex]. Value.ToString ());

does not work.

Datakeys is "ID" in GridView.

Please tell me where the error occurred.


View Complete Post

More Related Resource Links

symmetric key protected by a password

An alternative could be using a symmetric key protected by a password, as long as your application generates the CREATE SYMMETRIC KEY and OPEN SYMMETRIC KEY statements directly instead of calling them inside a SP (otherwise the password will still be passed as a parameter, and will be in clear in the profiler).

Crystal Report gives System.AccessViolationException: Attempted to read or write protected memory. T


when a crystal report for same id is opened again at same time or refreshed then it gives the

"System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

Stack Trace is :-

Stack Trace:

[AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.]
CrystalDecisions.ReportAppServer.Controllers.DatabaseControllerClass.SetConnectionInfos(ConnectionInfos ConnectionInfos) +0
CrystalDecisions.CrystalReports.Engine.Table.ApplyLogOnInfo(TableLogOnInfo logonInfo) +362
CrystalDecisions.CrystalReports.Engine.ReportDocument.SetTableLogon(Tables tables, String user, String password, String server, String database, Boolean ignoreCase) +258
CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDatabaseLogon(String user, String password, String server, String database, Boolean ignoreCase) +204

Are You Protected?: Design and Deploy Secure Web Apps with ASP.NET 2.0 and IIS 6.0


Ensuring the security of a Web application is critical and requires careful planning throughout the design, development, deployment, and operation phases. It is not something that can be slapped onto an existing application. In this article, Mike Volodarsky outlines best practices that allow you to take advantage of the security features of ASP.NET 2.0 and IIS 6.0 to build and deploy more secure Web applications.

Mike Volodarsky

MSDN Magazine November 2005

After a void the HTMLEditor gets the focus?

 I've got a aspx page with 2 update panels. The first has a HTMLEditor (ajax control toolkit), and the second had a textfield and a butten.after i push the button (of course there is some action but no focus things) afther the action is done the focus gets to the HTMLeditor.Why ? There is no page reload (because of the updatepanel) so why get the htmleditor the focus? And the importent thing, how can i solve this?

LINQ to SQL compiler error CS1519: Invalid token 'void' in class, struct, or interface member decl

I get the following compiler errors when creating my first LINQ to SQL class (I just dragged a table "ProfileExtended" onto the designer and hit build):DataClasses.designer.cs(31,11): error CS1519: Invalid token 'void' in class, struct, or interface member declaration these are the offending lines of autogenerated code:#region Extensibility Method Definitions  partial void OnCreated();  partial void InsertProfileExtended(ProfileExtended instance);  partial void UpdateProfileExtended(ProfileExtended instance);  partial void DeleteProfileExtended(ProfileExtended instance);  #endregion

Open a password protected package in C#

Hi - trying to write an app that opens packages in C# but have hit a stumbling block - how do you open a package that is password protected? The code I am using is: app.LoadPackage(packagepath, null) But I can't see how to pass the password in, so the code throws an exception. Cheers, James James Beresford @ www.bimonkey.com SSIS / MSBI Consultant in Sydney, Australia SSIS ETL Execution Control and Management Framework @ SSIS ETL Framework on Codeplex

Protected Delegate Sub AsyncTaskDelegate()

 I am trying to get this to bind to a gridview, without any luck. I would like each asynctask to ultimately return seperate datasets, but for now I can deal with the same one being returned.<%@ Page Language="VB" AutoEventWireup="false" CodeFile="testAsynch.aspx.vb" Inherits="testAsynch" Async="true" AsyncTimeout="450" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script language="javascript" type="text/javascript"> function abortTask() { var obj = Sys.WebForms.PageRequestManager.getInstance(); if (obj.get_isInAsyncPostBack()) obj.abortPostBack(); } </script> <style type="text/css"> #UpdateProgress1 { width: 270px; background-color: #ffff99; height: 120px; top: 40%; left: 35%; position: absolute; border: solid 1px black; } #ProgressTemplate1 { font-size: 9pt; color: navy; font-family: verdana;

Call a Protected sub from JavaScript

Hi there,                first at all I would like to ask your opinion on what we are doing. Having a ModalPopupExtender, the idea is to run a delete process from a SqlDataSource when Cancel button is clicked. Our approach is as showed below:     <script type="text/javascript">        function deleteRec() {            alert("Call a Protected Sub btnNo_Click!");                    }            </script>                    <asp:ModalPopupExtender ID="Panel1_ModalPopupExtender" runat="server"                          PopupControlID="Panel1" DynamicServicePath="" Enabled="True"                         TargetControlID="btnFirePopup" BackgroundCssClass=&quo

Getting Error "Attempted to read or write protected memory. This is often an indication that other m

Exception Details: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.Gyanendra

Attempted to read or write protected memory. This is often an indication that other memory is corrup

Hi people, Suddenly I'm getting this error specifically when I browse to the Calulation tab in an Analysis Services BIDS project. I have 2 cubes withing the project & both error when I try to create a calculation. One gives this message Attempted to read or write protected memory. This is often an indication that other memory is corrupt the other this one Unexpected error occurred. Error in the application. Has anyone else seen this & if so, how did you fix it ? Only one of the cubes in question has any calculations defined, however due to the scenario above I can't see it to edit

Passing Credentials to IIS "Integrated Windows authentication" Protected Directory

Hello All,I have set up a directory on my IIS web server that is protected by "Integrated Windows authentication".  I want visitors to be required to enter a name and password to view files in the protected directory except if they are following a link to files in the protected directory from a certain page on my website.I am doing this to try to get better protection from search engine spidering than is provided by using a robots.text file. I am using ASP.NET 3.5 with VB.  I am wondering if there is a way to pass the log on credentials to the IIS server via a link, or if there is a way to fill in the name and password for the login screen automatically, or something else that would work.  It is OK if the login name and password are visible to the visitors.Any suggestions on how to do this would be appreciated or if there is a better way to accomplish what I am trying to do, I would like to know.Thanks 

SSIS Package Protection Level Errors - decrypt protected XML node "DTS:Password" with error 0x800900

Error 7 Error loading GetData.dtsx: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.   c:\Packages\GetData.dtsx 1 1  Error 8 Validation error. Data Flow Task: OLEDB Source [5310]: The AcquireConnection method call to the connection manager "SourceServer" failed with error code 0xC0202009. GetData.dtsx 0 0 Environment I need to execute - BIDSHave Solution, with files linked with VSS. When I click on package, aforesaid errors show up and package opens in designed.Protection Level : Encrypt Sesitive with User KeyThis means it'd run only on machine and by user where and who created respectively.So I changed it to Encrypt Sesitive with Passoword and provided Passoword. No luckSo I changed it to Do not save sensitive, as anyways in the connection manager, it has Expression saying @Variablename (with appropriate correct syntax), and variable is mapped to config file. I tired with Config file and also by hardcoding the value in the connection manager's connection string after removing the variable name, also tried by hardcoding value in variable value and disabling config file.Nothing works. I read 3 threads discussing this issue by othe

can the void main function be called all the time, when activated as a feature.

Hi, I have a console application using C#, in which i have a custom code under the static void main. I would like to know, if the console application is made to a feature and activated, will the static void main function be called all the time, without waiting for any events to be trigerred. Thank you

ASP.net UPS void wsdl error message 'exception has been raised as a result of client data'


exception has been raised as a result of client data. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol

Void shipment erro message; I can't determine how to resolve error.  at ***

The following is the code for ups void shipment wsdl...

protected void wsdlRate()


RateWSs.RateRequest rateReq = new RateRequest();RateWSs.UPSSecurity rateSecurity = new RateWSs.UPSSecurity(); RateWSs.UPSSecurityServiceAccessToken rateToken = new RateWSs.UPSSecurityServiceAccessToken

Failed to decrypt protected XML node "DTS:Password" with DontSaveSensitve Checked



I have been researching and researching this.  First, I have all my packages all have the protection level set to DontSaveSensitive.  Second, all my passwords are stored in a config file.  This config file location is stored in an env variable.  The packages are all calling the config files from package configurations.

If I do the development on our dev server I dont' have a problem. As soon as I go to our test box, I get the error or if another person accesses it and tries to run it they get the error.

I have no idea to fix this.  The only solution I have found anywhere is to change the protectionlevel.  Changing it to rely on server gives me more error messages.  I honestly don't remember having this issue before now.

please help!



difference between internal and protected internal


 good evenning all,


I want to what is difference between Internal and protected internal.

Has anybody experienced problems opening 'protected Excel 2007 worksheets in SPS 2003?


I have added the doc icons and MIME types to my SPS2003 farm and now it works properly with Office2007 documents, with the exception of 'protected' Excel files.  In those cases where the Excel file contains a 'protected' worksheet, the user can open the doc, unprotect the worksheet and make their edits.  When they 'protect' the worksheet again and try to save the file, they get an alert that the destination file is 'read-only' and they must save it with a different name.

This only happens for 'protected' Excel 2007 docs residing on an SPS2003 site.  Protected Excel 2003 documents work fine, as do unprotected documents.  Any help y'all can be is greatly appreciated.  I only have two users who are using the protected worksheets, but they are the most vocal of my users.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend