<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tag 'save'</title><link>http://forums.asp.net/search/SearchResults.aspx?q=&amp;tag=save&amp;orTags=0&amp;o=DateDescending</link><description>Search results matching tag 'save'</description><dc:language>en-US</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>the form don't save</title><link>http://forums.asp.net/thread/3380608.aspx</link><pubDate>Tue, 01 Sep 2009 04:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3380608</guid><dc:creator>joaoluizbt</dc:creator><description>&lt;p&gt;&amp;nbsp;Hi friends,&lt;/p&gt;
&lt;p&gt;I have a web form with some textboxes and dropdownlists. The dropdownlists work, aparently correct, as it shows the correct itens and i can select one of them. But... when i finish to fill the form, select the iten in the dropdownlist and press the button SAVE, the information of the form don&amp;#39;t save in the table. the screen stand still on the same form with the information. Nothing happens.&lt;/p&gt;
&lt;p&gt;This is my code of repository, controll and view:&lt;/p&gt;&lt;pre class="c-sharp" name="code"&gt;public class EmpresaRepositorio

    {

        private HeraSupportDataContext db = new HeraSupportDataContext();

        // Métodos de inserção e deleção

        public void Adicionar(Empresa empresa)

        {

            db.Empresas.InsertOnSubmit(empresa);

        }

        // Persistence

        public void Salvar()

        {

            db.SubmitChanges();

        }

    }&lt;/pre&gt;
&lt;p&gt;The controll code:&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="c-sharp" name="code"&gt;public class EmpresaFormViewModel

    {

        // Properties

        public Empresa empresas { get; private set; }

        public TipoContratoRepositorio tipocontratorep = new TipoContratoRepositorio();

        public LicenciadaRepositorio licenciadarep = new LicenciadaRepositorio();

        public SelectList tiposContrato { get; private set; }

        public SelectList licenciadas { get; private set; }

        // Constructor

        public EmpresaFormViewModel(Empresa Empresas)

        {

            empresas = Empresas;

            tiposContrato = new SelectList(tipocontratorep.SelecionarTodos(),&amp;quot;cod_tipo_contrato&amp;quot;, &amp;quot;descricao&amp;quot;);

            licenciadas = new SelectList(licenciadarep.SelecionarTodas(), &amp;quot;cod_licenciada&amp;quot;, &amp;quot;nome&amp;quot;);

        }

    }



    // Controller Class

    public class EmpresaController : Controller

    {

        // GET: /Empresa/Adicionar

        [Authorize]

        public ActionResult Adicionar()

        {

            Empresa Empresa = new Empresa();

            if (User.Identity.Name == null)

                return View(&amp;quot;InvalidUser&amp;quot;);

            return View(new EmpresaFormViewModel(Empresa));

        }

        // POST: /Empresa/Adicionar

        [AcceptVerbs(HttpVerbs.Post), Authorize]

        public ActionResult Adicionar(Empresa Empresa)

        {

            if (User.Identity.Name == null)

                return View(&amp;quot;InvalidUser&amp;quot;);

            {

                try

                {

                    EmpresaRepositorio.Adicionar(Empresa);

                    EmpresaRepositorio.Salvar();

                    return RedirectToAction(&amp;quot;Detalhe&amp;quot;, new { id = Empresa.cod_empresa });

                }

                catch

                {

                    ModelState.AddModelErrors(Empresa.GetRuleViolations());

                    return View(new EmpresaFormViewModel(Empresa));

                }

            }

        }

    }&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;And the view code:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="c-sharp" name="code"&gt;&amp;lt;%@ Control Language=&amp;quot;C#&amp;quot; Inherits=&amp;quot;System.Web.Mvc.ViewUserControl&amp;lt;HeraSupport.Controllers.EmpresaFormViewModel&amp;gt;&amp;quot; %&amp;gt;

    &amp;lt;% using (Html.BeginForm()) {%&amp;gt;

 

        &amp;lt;fieldset&amp;gt;

            &amp;lt;p&amp;gt;

                &amp;lt;label for=&amp;quot;nome&amp;quot;&amp;gt;Nome:&amp;lt;/label&amp;gt;

                &amp;lt;%= Html.TextBox(&amp;quot;nome&amp;quot;, Model.empresas.nome)%&amp;gt;

                &amp;lt;%= Html.ValidationMessage(&amp;quot;nome&amp;quot;, &amp;quot;*&amp;quot;) %&amp;gt;

            &amp;lt;/p&amp;gt;

            &amp;lt;p&amp;gt;

                &amp;lt;label for=&amp;quot;cod_tipo_contrato&amp;quot;&amp;gt;Tipo de Contrato:&amp;lt;/label&amp;gt;

                &amp;lt;%= Html.DropDownList(&amp;quot;tiposContrato&amp;quot;, this.ViewData[&amp;quot;tiposContrato&amp;quot;] as SelectList, &amp;quot;Selecione um tipo de contrato&amp;quot;) %&amp;gt;                

                &amp;lt;%= Html.ValidationMessage(&amp;quot;TipoContrato&amp;quot;, &amp;quot;*&amp;quot;) %&amp;gt;

            &amp;lt;/p&amp;gt;



            &amp;lt;div&amp;gt;

                &amp;lt;a href=&amp;quot;/empresa&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;../../Content/img/voltar.jpg&amp;quot; alt=&amp;quot;Voltar às empresas&amp;quot; class=&amp;quot;image&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt;

                &amp;lt;input type=&amp;quot;image&amp;quot; src=&amp;quot;../../Content/img/salvar.jpg&amp;quot; alt=&amp;quot;Salvar&amp;quot; class=&amp;quot;image&amp;quot;/&amp;gt;

            &amp;lt;/div&amp;gt;

        &amp;lt;/fieldset&amp;gt;

        

    &amp;lt;% } %&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>hi</title><link>http://forums.asp.net/thread/2740323.aspx</link><pubDate>Wed, 12 Nov 2008 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2740323</guid><dc:creator>asp.netlearner</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I want to disable some options on right click an image.How to disable the options &amp;#39;&amp;#39;save picture as&amp;#39;&amp;#39;,&amp;#39;&amp;#39;copy&amp;#39;&amp;#39;,&amp;#39;&amp;#39;paste&amp;#39;&amp;#39;,&amp;#39;&amp;#39;E-mail picture&amp;#39;&amp;#39;,&amp;#39;&amp;#39;set as desktop item&amp;#39;&amp;#39;,&amp;#39;&amp;#39;set as back ground&amp;#39;&amp;#39;,&amp;#39;&amp;#39;save target as&amp;#39;&amp;#39;,&amp;#39;&amp;#39;print target&amp;#39;&amp;#39;,&amp;#39;&amp;#39;print picture&amp;#39;&amp;#39; in asp.net webpage.Is there any java script for that or we can write any html code.Can anyone please help me?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank you.&lt;/p&gt;</description></item><item><title>Check viewState before save data</title><link>http://forums.asp.net/thread/2717502.aspx</link><pubDate>Fri, 31 Oct 2008 04:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2717502</guid><dc:creator>ASPCloud</dc:creator><description>&lt;p&gt;Hi All,&lt;/p&gt;
&lt;p&gt;I have been googling around but cannot find the exact solution, hope somebody here can point me to the right direction, thanks in advance.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Problem Scenario:&lt;/p&gt;
&lt;p&gt;Do not try to save webform data into database if it has not been changed, need to achieve this by using viewstate.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Example: &lt;/p&gt;
&lt;p&gt;A textbox hold the name of a customer, and user enter their name&amp;nbsp;then click on submit and data&amp;nbsp;is save into the database. &lt;/p&gt;
&lt;p&gt;While the&amp;nbsp;code works well on just small number of fields,&amp;nbsp;I&amp;nbsp;have&amp;nbsp;multiple&amp;nbsp;webforms each contains more than 50 fields (mostly textboxes). So I need to check to see if data has actually been change&amp;nbsp;for all the fields in the webform, I know ViewState is storing the state of each control on the webform, so when user click a button causes a postback, data is reload back to the fields. My key question is how to use this last viewstate data to compare currect control data to see if data has been changed? All this is for performance issue, so the website to not hammer the SQL Server database&amp;nbsp;when it is not neccessary.&lt;/p&gt;
&lt;p&gt;I was looking for something like:&lt;/p&gt;
&lt;p&gt;if(ViewState[&amp;quot;txtName&amp;quot;].ToString() == txtName.Text) {&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //no change, do not save&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;else {&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //data changed, then save&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;But ViewState[&amp;quot;txtName&amp;quot;] is actually null, looks as I need to manually assign a value into it at the first place. But Im sure ViewState load the data back into txtName when postback happens. Any ideas?&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>How to use XDocument.Save?</title><link>http://forums.asp.net/thread/2462429.aspx</link><pubDate>Wed, 02 Jul 2008 04:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2462429</guid><dc:creator>Dynamic2008</dc:creator><description>&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Save()&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;
&lt;blockquote&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XDocument&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; xDocument = &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XDocument&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Load(FILE_PATH);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;var&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; parameter = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;from&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; p &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;in&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; xDocument.Descendants(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XName&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Get(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;Parameter&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;))&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;where&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; p.Attribute(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XName&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Get(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;name&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)).Value == &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Value&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;select&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; p;&lt;/p&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;foreach&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XElement&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; xElement &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;in&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; parameter)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;
&lt;blockquote&gt;xElement.Attribute(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XName&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Get(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;value&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)).SetValue(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Value); &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;break&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/blockquote&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;xDocument.Save(FILE_PATH);&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;My xml file is like this:&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;?&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;xml&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;version&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;1.0&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;encoding&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;utf-8&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt; ?&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt; 
&lt;p&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;Parameters&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;Parameter&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;name&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;HRInteranet_Uri&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;value&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;a href="https://www.domain.com%22%3e%3c/Parameter"&gt;https://www.domain.com&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;Parameter&lt;/a&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;&amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;Parameters&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;The code doesn&amp;#39;t update the document, any help?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: .Net 2.0 Ajax erases input data</title><link>http://forums.asp.net/thread/2391564.aspx</link><pubDate>Fri, 30 May 2008 04:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2391564</guid><dc:creator>haiwag</dc:creator><description>&lt;p&gt;After one day&amp;#39;s work on removing .Net Ajax and make all field my own Ajax (NickAjax), I can call it real partial asynchronized postback - a goal that .Net 2.0 Ajax said in their feature, but failed to deliver to real life. &lt;/p&gt;&lt;p&gt;I have 4 tab pages, there are 10 fields in the first tab. I set a 5 sec delay at ajax server process side, so when I input 10 fields data, a 5 seconds delay is generated each time I finish one field and switch to another one. Amazingly, I can keep typing after previous change goes to server,&amp;nbsp; --- this is what i meant asynchronize; and everything I typed is well kept after the previous ajax process finished. I.e. I can seamlessly input data, and ajax working behind scene without interference.&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;So if I type in data for 5 seconds each field, that means after my last typing, I only need another 5 seconds for the last one to go in. The worst case if I type in all 10 fields in no time, I will wait 50 seconds.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;But, wait a sec, there is a problem, after I fill in a field, click Save button, my change is not saved. I have to click again, this time it is saved. That sucks - I worked on this times for the last 2 years, no one of my tries work prefectly. I have to change my way on this, I believe there should a way to figure out which button I was clicking on, so after the ajax process, if I check a Save button was clicked, a save process could be launched. So now I am working on this.&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: &amp;quot;Save&amp;quot; DELETED entries to new Table</title><link>http://forums.asp.net/thread/2249714.aspx</link><pubDate>Sun, 23 Mar 2008 04:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2249714</guid><dc:creator>fossil83</dc:creator><description>&lt;p&gt;Hi XPSCodes&lt;/p&gt;
&lt;p&gt;Indeed it will, but how does one convert your select / update / delete statement to a trigger - where do you begin? I would&amp;#39;ve added the query to VWD2008, but it also makes sense to add it to SQL in the backend. &lt;br /&gt;&lt;br /&gt;I&amp;#39;ve managed to get some code of another website, which is easy to read, and easy to understand. I&amp;#39;ve also added a ArchiveID to the new table, which will &lt;em&gt;&lt;strong&gt;Indentity Specification&lt;/strong&gt;&lt;/em&gt; by 1 each time a record is deleted in the main table, and inserted in the archive table. So, a record with the same details could be deleted twice, with diffrent ArchiveID&amp;#39;s.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;The Code:&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;USE&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; SurveyBonusDB&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;DELETE&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;FROM&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; tblUsers&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;OUTPUT&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Deleted&lt;/font&gt;&lt;font color="#808080" size="2"&gt;&lt;font color="#808080" size="2"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;UserID&lt;/font&gt;&lt;font color="#808080" size="2"&gt;&lt;font color="#808080" size="2"&gt;,&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;Deleted&lt;/font&gt;&lt;font color="#808080" size="2"&gt;&lt;font color="#808080" size="2"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;Name&lt;/font&gt;&lt;font color="#808080" size="2"&gt;&lt;font color="#808080" size="2"&gt;,&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;br /&gt;Deleted&lt;/font&gt;&lt;font color="#808080" size="2"&gt;&lt;font color="#808080" size="2"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;Surname&lt;/font&gt;&lt;font color="#808080" size="2"&gt;&lt;font color="#808080" size="2"&gt;,&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;Deleted&lt;/font&gt;&lt;font color="#808080" size="2"&gt;&lt;font color="#808080" size="2"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;Initials&lt;/font&gt;&lt;font color="#808080" size="2"&gt;&lt;font color="#808080" size="2"&gt;,&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;br /&gt;Deleted&lt;/font&gt;&lt;font color="#808080" size="2"&gt;&lt;font color="#808080" size="2"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;PayrollNumber&lt;/font&gt;&lt;font color="#808080" size="2"&gt;&lt;font color="#808080" size="2"&gt;,&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;Deleted&lt;/font&gt;&lt;font color="#808080" size="2"&gt;&lt;font color="#808080" size="2"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;LocationID&lt;/font&gt;&lt;font color="#808080" size="2"&gt;&lt;font color="#808080" size="2"&gt;,&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;br /&gt;Deleted&lt;/font&gt;&lt;font color="#808080" size="2"&gt;&lt;font color="#808080" size="2"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;RoleID&lt;/font&gt;&lt;font color="#808080" size="2"&gt;&lt;font color="#808080" size="2"&gt;,&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;br /&gt;Deleted&lt;/font&gt;&lt;font color="#808080" size="2"&gt;&lt;font color="#808080" size="2"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;DateAdded&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;INTO&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; tblUsersArchive&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;WHERE&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; UserID &lt;/font&gt;&lt;font color="#808080" size="2"&gt;&lt;font color="#808080" size="2"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;&amp;#39;7&amp;#39;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;br /&gt;GO &lt;/p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;
&lt;p&gt;-- Verification in the base table&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;SELECT&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#808080" size="2"&gt;&lt;font color="#808080" size="2"&gt;*&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;FROM&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; tblUsers&lt;br /&gt;GO&lt;/p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;
&lt;p&gt;-- Verification in the auditing table&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;SELECT&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#808080" size="2"&gt;&lt;font color="#808080" size="2"&gt;*&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;FROM&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; tblUsersArchive&lt;br /&gt;GO&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Save a Form using Ctrl + S????</title><link>http://forums.asp.net/thread/2043876.aspx</link><pubDate>Wed, 05 Dec 2007 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2043876</guid><dc:creator>tbraga</dc:creator><description>&lt;p&gt;Hi Guys, &lt;/p&gt;
&lt;p&gt;Was just thinking about this and couldn&amp;#39;t find anything on the net about it.&amp;nbsp; Can you use keywords such as Ctrl S to save an ASP.net 2.0 form or other keywords?&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Just point me in the right direction...if possible of course&lt;br /&gt;Thanks in advance!&lt;br /&gt;Tim&lt;/p&gt;</description></item><item><title>Re: ASP.NET 2.0 Post to another Page Search Problem (txtName)</title><link>http://forums.asp.net/thread/1612047.aspx</link><pubDate>Thu, 08 Mar 2007 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1612047</guid><dc:creator>zhuhhu</dc:creator><description>&lt;p&gt;Still has problem: &lt;br /&gt;see below:&lt;br /&gt;&amp;lt;asp:Label ID="Label1" runat="server" Text="Label"&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;/p&gt;
&lt;p&gt;if &amp;lt;..Text="Lable"&amp;gt;&lt;br /&gt;Then search result from is to match any words including "Label" &lt;br /&gt;if &amp;lt;..Text="Name"&amp;gt;&lt;br /&gt;Then search result is to match any words including "Name" &lt;/p&gt;
&lt;p&gt;How?&lt;/p&gt;
&lt;p&gt;Please Help ASAP.&lt;br /&gt;Thanks.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Error :Session state has created a session id, but cannot save it because the response was already flushed by the application.</title><link>http://forums.asp.net/thread/1576342.aspx</link><pubDate>Tue, 13 Feb 2007 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1576342</guid><dc:creator>softer</dc:creator><description>&lt;p&gt;That happens because sometimes (depending on the web.config configuration) the SessionID is not set in the cookie when Session_Srtart event executes in the global asax.&lt;/p&gt;
&lt;p&gt;You encounter this error because at somepoint in the pagelifecycle a variable is set in the session. After the request ends, ASP.NET tries to set the SessionID too, but if the Request was flused (eg. this can be done by Response.Write or AJAX itself flushes the response) this exception will be thrown.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;A simple fix would be (in the global.asax file):&lt;/p&gt;&lt;pre class="coloredcode"&gt; &lt;span class="kwd"&gt;void&lt;/span&gt; Session_Start(&lt;span class="kwd"&gt;object&lt;/span&gt; sender, EventArgs e) 
    {
&lt;span class="cmt"&gt;	// Code that runs when a new session is started

	//Ensure SessionID in order to prevent the folloing exception
	//when the Application Pool Recycles
	//[HttpException]: Session state has created a session id, but cannot 
	//				   save it because the response was already flushed by &lt;/span&gt;
	&lt;span class="kwd"&gt;string&lt;/span&gt; sessionId = Session.SessionID;
    }&lt;/pre&gt;&amp;nbsp;</description></item><item><title>Re: Error :Session state has created a session id, but cannot save it because the response was already flushed by the application.</title><link>http://forums.asp.net/thread/1576341.aspx</link><pubDate>Tue, 13 Feb 2007 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1576341</guid><dc:creator>softer</dc:creator><description>&lt;p&gt;That happens because sometimes (depending on the web.config configuration) the SessionID is not set in the cookie when Session_Srtart event executes in the global asax.&lt;/p&gt;
&lt;p&gt;You encounter this error because at somepoint in the pagelifecycle a variable is set in the session. After the request ends, ASP.NET tries to set the SessionID too, but if the Request was flused (eg. this can be done by Response.Write or AJAX itself flushes the response) this exception will be thrown.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;A simple fix would be (in the global.asax file):&lt;/p&gt;&lt;pre class=coloredcode&gt; &lt;span class=kwd&gt;void&lt;/span&gt; Session_Start(&lt;span class=kwd&gt;object&lt;/span&gt; sender, EventArgs e) 
    {
&lt;span class=cmt&gt;	// Code that runs when a new session is started

	//Ensure SessionID in order to prevent the folloing exception
	//when the Application Pool Recycles
	//[HttpException]: Session state has created a session id, but cannot 
	//				   save it because the response was already flushed by &lt;/span&gt;
	&lt;span class=kwd&gt;string&lt;/span&gt; sessionId = Session.SessionID;
    }&lt;/pre&gt;&amp;nbsp;</description></item></channel></rss>