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

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

How to implement disabling save button when filename is blank in SaveFileDialog

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :Windows Application


Now I want to implement the functionality that disabling the save button when the file name is blank in SaveFileDialog. But the class doesn't provide any properties or events to achieve this goal. And it is also a sealed class, so inheritance cannot be used. Can anybody provide me some suggestions on it, such as using Windows API or customized dialog?



View Complete Post

More Related Resource Links

need help to implement validation with save button

hi, i was defeated a problem relating to the save button. i am running vb.net 2005 and the database is access. i have a project with application so there's a form which i wanted to restrict the user to fill all the textfields. say there are 5 textfiled(Fname, email and so on). what i am interested is that when even some one open the form and tries to fill some of them, there should be prompting message asking them to fill all, else the save button has to do its task. here's the code i was playing around but got a problem that when i fill all the text fields, there's no save only the restricting msg appears(" plz, fill the form probably then click save") NB: i put this code inside the save button. --------------------------------------------------------------- Dim success As Boolean Private Sub Save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Save.Click If Product_DetailsBindingSource.Current Is Nothing Then MessageBox.Show("plz, fill the  feilds then click save button", Me.Text) success = False Else Me.Validate() success = DirectCast(Product_DetailsBindingSource.Current, products).Save() MessageBox.Show("save has completed successfully") Panel1.Show() End If   ------------------------ thanks so mch best regards hossenel

How to implement save to csv method.


Hi All,

I have customer data saved into my database. when the customer access this data through his login and if clicks save to csv, the data has to be saved into their local machine. I am using asp.net version 1.1 and VS2003. Please help me out.

Creating a "Save Button" in a browser based Form

I'm not sure if I'm missing something obvious, but I need to have the funtionality of the "Save Button", which is available and works on the tool bar, available in the form...and I can't seem figure out how to do it.I've found examples, in this forum, of how to use the "Submit Button" to act as the "Save Button", which did work for me, but only when specific basic criteria was met.The criteria that I now have is that I'm initiating a workflow to automatically start when a new item is created.  My workflow then moves the form to one of a few possible different form libraries, based on the logic in my workflow.  The different form libraries are to manage different teams of people that would have access to the Form and then that team would process the form accordingly.My specific situation: 1 - User opens a new form (works) 2 - User enters data and then submits the new form (works) 3 - Workflow is initiated and the form is moved to another form library to be worked on by a select group of people (works) 4 - The form is opened and reviewed and some changes are made to the form data by the select group of people (works) 5 - The form data in the form libary is updated (works, but only if the save button is pressed in the tool bar and then manually closes t

Enable Disable Save Button in Winforms App

Hi, In our windows forms application we have many forms with "Save" buttons. We want to enable them only if the data in the form is changed. At the moment it is handed by adding flags to check whether the data is dirty. Is there any easy way to handle this? May be something with the famework? Thanks,CJ

Confirmation prompt when click on "save" button?

Currently I am working on SharePoint 2010 project that my customer want something like confirmation prompt, (e.g. upon click on “save” button, system prompts “are you sure you want to save?”) for all following 8 area: ·         Document Repository (meta-data) ·         Calendaring ·         News ·         Task List ·         Quick Links ·         Blogs ·         Wiki ·         Forums   Is this possible?  Has anyone done this or something similar?  Can anyone point me to some examples or best practices when doing this? Thanks Believing is Seeing

find the label control of gridview in save button event in C#

hi, every one..i want save the gridview in buttonsave event..here i wrote the code like thisfor (int i=0;i<gridview1.row.count;i++){label lbl=(label)gridview1.rows[i].findcontrol("lbl");Textbox txtname=(Textbox)gridview1.rows[i].findcontrol("txtname");}here i got the textbox value but am not getting label value how to get that label value..thanks in advance

How to add a new button to the newform.aspx page which says "Save and add another record" ?

Team, I have a scenario where my client wants me to add a nother button to NewForm.aspx page in addition to Save and Cancel buttons. The job of that buttom should be to save the record and open that new form again. Is this possible.If yes can you guie me how to do it though designer? Thanks in advance. Deepti.  

How can you remove the Save button on a survey?

What options are there to remove the SAVE button from a SharePoint survey?I need to remove this if possible, I was hoping it would be as simple as editing a form in the Survey list... but that is apparently not the case.I need to supress the SAVE button as it confuses end users and we don't want any half completed surveys. Either it gets finished or not at all.Can someone hopefully provide me with an nice simple solution?  Or any solution at all :)Thanks!

How to show a message box on an invalid filename entered while saving a file using save file dialog

Hi all i have written a code to display a message box if invalid characters are entered while saving the file but my message box is not displaying. Actually i will have a save file dialog option to save a file if the filename starts or consists of the following    \\/:*?<>|"  I would like to display a message box as invalid or illegalcharacters in file My code is as follows    Stream myStream;                          SaveFileDialog saveFileDialog1 = new SaveFileDialog();                            saveFileDialog1.InitialDirectory = @"C:\";                          saveFileDialog1.DefaultExt = "txt";                          saveFileDialog1.Filter = "(*.txt)|*.txt";                          saveFileDialog1.FilterIndex = 2;                          saveFileDialog1.RestoreDirectory = true;                            if (saveFileDialog1.ShowDialog() == DialogR

My script is disabling the page edit button (not intentionally)

I have a jQuery script that injects content into a publishing page.  When it does, the edit button (the little one beside the browse tab) no longer works.  If I don't run the script on page Ready, but run it through the Firefox console after the page has fully loaded, everything works fine.  All I can deduce is that some SP script is assigning an event to the edit button after the page is loaded, and my script seems to be conflicting with it.  I have tried using various delay methods such as ExecuteOrDelayUntilScriptLoaded, but nothing seems to work. Is there any way of telling when SP has finished all it's scripts on page ready?   I've spent hours on this, so am ready to just re-assign the click event, but don't think that's a great solution. Appreciate any insight.

Form Validation, BindingGroup, CommandBinding, Disabling Commit Button

Hi, I've been struggling with this for a few days and I couldn't get a clear and simple answer anywhere. Now that I've fixed the problem on my end, I figured I would share. The approach is about disabling a "Commit" button (Save/Apply/OK/whatever) whenever an error exists in the form. Basically, I have a form with several different controls (textbox, combobox, checkbox to name a few). All of them are bound to a custom object within my code, that I referenced using "RootGrid.DataContext = myObjectInstance". They also use BindingValidationRules, so the user is warned that they have wrong data in there. There's plenty of information about how to achieve this on the internet - but the real question mark is: how can I disable a button if there are errors in the form? First, go ahead and make those control validations work. For example, write a ValidationRule for a textbox to make sure it's only numbers in there, and then another ValidationRule for another textbox that ensures no digits are contained. Once again, google is full of examples on how to achieve this. Then, you need to group all of those controls into a BindingGroup. Before doing so, we will design a ValidationRule that will ensure the BindingGroup is free of validation errors:   public class ErrorFreeBindingGroup : ValidationRule { private string _errorMessage; public str

can i save to a Sharepoint List from an InfoPath form created from Blank template


Guys, i am using SharePoint 2010. i created a form using InfoPath, created hi using the Blank form Template, all i want to do is save this to an existing SharePoint 2010 List using writing code. I also tried creating a DataSource connection but when i select the optoin for "Submiting Data" it does not show me an optoin to save data to a sharepoint list. Cand i do this using SharePoint webservices, if yes then how is it possible.

thanks in Advance


Ribbon Save Button Causes Validation


On a publishing site in 2010, it appears that the ribbon save button triggers validation on validators that have a specific validation group defined.  I'm confused as to how this happens, but it apparently does.

I have a web part with a simple input form and some validators.  When switching out of edit mode, the validators are triggered and the page won't switch back to normal view.

Any ideas?

Save button on custom EditForm.aspx locks record



I am having an issue with my EditForm.aspx on a list. My problem is that when I make a change to a record and click save (and it brings me back to the page), the first set of changes are saved fine but if I then enter more content and click save without refreshing the page I get the error:

 Save Conflict.

Your changes conflict with those made concurrently by another user. If you want your changes to be applied, click Back in your Web browser, refresh the page, and resubmit your changes.


This is the code that I am using for my save button:

<input type="button" value="Save Changes" name="btnFormAction" onclick="javascript: {ddwrt:GenFireServerEvent('__commit')}" style="padding: 5px; border-style: none; background-color: #21374c; color: #FFF; font-weight: bold; font-size: 14px;" />

 Is there something I need to add to my code that unlocks the record once it has been saved?

Thanks in advance for the help :)


How do you save state of a toggle button after partial postback?


lets say you  have the toggle buttons from this page: http://www.filamentgroup.com/examples/buttonFrameworkCSS/

and you put it in a UpdatePanel AJAX...  so lets say on a partialpostback.. when you re-create teh controls on server-side, the state of whether or not those buttons were pushed is long-lost and gone.. so how then how do you remember those states?

Can I save each button state into viewstate or session state?  regenerate each button then call the javascript function to change its color-state depending on the session state variable?


Save as template button is disabled



I want to save a site as template so I can create a new site based on this template.
In SP2007 this was easy by opening site settings > site actions > save as template
In SP2010 this link is missing, and in SharePoint Designer the button in the ribbon is greyed out.

All of the sites in SharePoint show this behavior, I cannot save any of my sites as template (the link is not there in SharePoint, and in SPD the button is disabled).
Do I need to enable some feature in SP2010 first in order to use this functionality ?

AutoPostBack issue with other web controls resulting in multiple clicks on "Save" Button


A new ASP.NET web application that I've been working on has among other web controls on the DetailView, a DropDownList for Category (ddlCategory) a TextBox for Quantity (txtQuantity) a Label for the Rate (lblRate) and a Label for the Amount (lblAmount) along with a Save button (btnSave), etc.; there are also TabIndexes set to progressively navigate from control-to-control ending on the Save button.  NOTE: the user would like to see the Rate & Amount values in the DetailView prior to saving the record.

The Rate is determined by the selected the Category so I have the AutoPostBack property set to "true" on ddlCategory to make a call to the database to retrieve the Rate on the SelectedIndexChanged event; likewise, the AutoPostBack property on txtQuantity is set to "true" in order to compute the Amount (and populate lblAmount) once the user enters a Quantity.  Theoretically, the user could enter the values sequentially and still go back to change the Category prior to the save so simply performing some client-side JavaScript to compute the Amount would not be bulletproof.

Everything works according to plan when the user tabs from control-to-control {e.g., Category > Quantity > Save}, or tabs off the control.  However, the problem occurs when the user enters all the values and then clicks on the Save button without tabbing off the

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