Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
S

Sebastian M

@Sebastian M
About
Posts
2
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • how to encrypt password in web.config?
    S Sebastian M

    The code you need to encrypt/decrypt your connection strings section in your web.config file looks like this: public void EncryptConfigSection(bool bEncrypt) { string pathToConfigFile = "~/"; Configuration config = WebConfigurationManager.OpenWebConfiguration(pathToConfigFile); ConfigurationSection connStrings = config.GetSection("connectionStrings"); if (true == bEncrypt) connStrings.SectionInformation.ProtectSection("DataProtectionConfigurationProvider"); else connStrings.SectionInformation.UnprotectSection(); config.Save(); } Sebastian M.

    ASP.NET question security tutorial

  • Populating Gridview on the value of Textbox
    S Sebastian M

    You can implement ICallbackEventHandler interface in your webpage and use client-callbacks to call the server when the Add button is pushed sending the text to be added as a param. You'll find the details on how to accomplish that here: http://msdn2.microsoft.com/en-US/library/system.web.ui.icallbackeventhandler.aspx Then, on the server side in the RaiseCallbackEvent method, add the text to the grid and render the grid to a StringWriter like this: StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture); HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter); yourGrid.RenderControl(htmlWriter); htmlWriter.Flush(); htmlWriter.Close(); string result = stringWriter.ToString(); You have to send back the result to the client side where you have to replace the outerHTML of the grid with the data you recive from the server. Your javascript function that recives the callback result and does the replacement should look something like this: function __onServerCallback(result, gridID) { else if (result.length) { // set the resulted data to the grid var grid = document.getElementById(gridID); grid.outerHTML = result; } } I hope this will help and I'm sure you will find good articles related to this subject on codeproject. Just search for ICallbackEventHandler. Sebastian M.

    ASP.NET csharp asp-net help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups