.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

saving the data and then deleting the data using javascript function in anchor tag

Posted By:      Posted Date: October 11, 2010    Points: 0   Category :SharePoint

Hello guys,

What I am trying to do is I have a dataview webpart. In that I have a field called comments which I made it as a text box. I have provided them a option delete. So user before deleting the item, he has to enter the comments and delete. The comments which I enter has to save in list. then I wrote one event handler which is for item deleting, which will copy values to other location deletes the list item.

The problem is the comments are getting saved to list before deleting. The javascript function for delete in anchor tag is 

<a href="javascript: if(DeleteItemConfirmation()) {ddwrt:GenFireServerEvent(concat('_cancel;__delete={',$KeyField,'=',$KeyValue,'};__commit;__redirect='};

so I have to save the comments before it gets deleted. So I am trying to insert {ddwrt:GenFireServerEvent('__commit;'};this in some place anchor tag before delete, but its getting saved, but not deleting.

Hope you guys understand what I am talking. So can I do something such that it saves the comments and go for delete...

View Complete Post

More Related Resource Links

showing modalpopup and saving data to database simultaneously using ajaxtoolkit and javascript

hi,i have a button ,i want that when i click on that button the data should be saved in the database as well as at the same time a modal popup should display the customerid .i have written the code as <asp:button id="save1" runat="server" onclick="Button4_Click" style=""z-index:" mode="hold" xmlns:asp="#unknown" /> left: 740px; position: absolute; top: 304px" Text="save"/> <asp:panel id="panel" runat="server" xmlns:asp="#unknown">  /asp:Panel> <ajaxtoolkit:modalpopupextender id="MPE" runat="server" targetcontrolid="save1" xmlns:ajaxtoolkit="#unknown"> PopupControlID="panel" DropShadow="true" BackgroundCssClass="modalBackground/> protected void Button4_Click(object sender, EventArgs e) { string id = TextBox1.Text; string name = TextBox2.Text; string cn = "Data Source=hcl;Initial Catalog=mydata;Integrated Security=True"; SqlConnection con = new SqlConnection(cn); SqlCommand cmd = new SqlCommand("insert into customer values (@id,@name)", con); con.Open(); cmd.CommandType = CommandType.Text; cmd.Parameters.Add("@id", id); cmd.Parameters.Add("@name",name); cmd.ExecuteNonQuery(); con.Close(); CUSTID.Text = id.ToString(); MPE.Show(); }

Saving data in javascript from codebehind and use data in other javascript functions


In the Page_Load event I want to write some data in javascript which can be used later via a javascript function.

Protected Sub Page_Load
'get data from database
    SELECT * FROM locations
'write the data in javascript
    Me.Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "ScriptKey", "var sDataArray = MultiDimensionalArray(0, 3);sDataArray[0][0]='THIS IS SOME DATA';", True)

End Sub

Then in the ActiveTabChanged event of the tabcontrol I want to use that data:

 function ActiveTabChanged(sender, e) {
     if (sender.get_activeTabIndex() == 1) {
         __doPostBack(sender.get_id(), sender.get_activeTabIndex());
 How can this be done?

Saving textbox data to MySql database in asp.net


Hi dear coders

though a very simple question to ask, but please tell me how to save and retrieve data in/from my textboxes to/from database (MYSQL) on submit button click.

i know its a very simple task but i cant make it done, so i request you to please send me some working example link or post any helpful code here in asp.net

i will be highly thankful for any kind help from you geniuses.



Enable Go Button after entering data in all fields using javascript funtion


Hi friends,

My page is having one gridview with check boxes,two textboxes and one button just like this see this link now i want to enable go button whenever user has select checkbox in gridview and he needs to enter text in two textboxes. i have written onkeyup event for two textboxes to test whether user enter text in textboxes or not but i am unable to write javascript function to check whether user has selected checkbox in gridview or not to enable go button .My requiremnet is user need to enter three inputs select atleast one checkbox in gridview and he needs to enter text in two textboxes.please friends pls tell me how to write javascript function to find whether user has selected the checkbox in gridview or not

search data in xml using javascript



  I have this problem regarding searching within a XML file.
idea is that my search will be based on the keyword entered
in by the user from a HTML form. the keyword is then used to search all
the nodes and the child nodes within a XML file. once the match
is found, i will have to display the results.

But i don't know how to do so - especially the part of searching xml file using javascript

anyone help me in this?

thanks in advance


Excel sheet is not saving data while sending email

Hey Guys,  I am creating a SSIS package, where I am getting all the data into the excelsheet1, which is not formatted. So i created a formated excelsheet2, where i am giving reference to excelsheet1 cells reference. And I am sending email by attaching excelsheet2.              I am having issue when the data is updated, but my email attachment excel is showing old data. When i open the excelsheet1 it is being updated. I don't know why excelsheet2 is not updated automatically. I am using BIDS 2005 . Can anyone please suggest what will solve my problem. Thanks in Advance Priyamvadha

Handle anchor tag when there is no data in data view

HI, I have a DataView Web part on my page.Announcements Data is binded to Data view and below the Dataview web part i have a anchor tag(See all Announcements link) which redirects to all announcemnts to a different page. Anchor tag is not a part of Data view....It's a seperate tag on the page My requirement is i don't want to show the All Announcements Link when there is no data. Is it better to have a CEWP to place my text 'See All Announcements' to handle this scenario? Thanks in advance. Ravi      

How to insert values into my table the data is coming from inline table valued function

Hi all,   i have table oi want insert values into my table the data is coming from inline table valued function how i can use the inline table valued function to insert datainto my table i have inline function which out puts 3 collumns of data how i can insert this data into my table i have the insert statment like below insert into tablename(c1,c2,c3,c4,c5) select ('abc',....................,'xyz') how i can use the out put put of my inline function to  to insert data into my columns c2,c3,c4. please help me out Thanks & Regards Sunil Yoganna

Deleting a row from the data table

Hi All  ,    .aspx  <table border="1">                            <tr>                              <th>Course Code</th>                              <th>Course NAme</th>                              <th>Fees</th>                              </tr>                                                           &nbs

Error: "Select statements included within a function cannot return data to a client"

hi all, Not sure if there is an easier way to do this but this is my first ever Function I created so far. I am getting the error: "Select statements included within a function cannot return data to a client" All I am trying to do is ...if the date is NOT passed then apply NULL as the default value and run the SELECT statement. If the date IS NOT null then run a different SELECT statement. CREATE FUNCTION [SchemaTest].[fn_Test] ( @instance as uniqueidentifier ,@date as datetime = null ) RETURNS varchar(8000) AS BEGIN If (@date is null) --@date = null ?? Begin Select * From Uds.RealtimeLogging Where instanceID = @instance End Else Begin Select * From Uds.RealtimeLogging Where instanceID = @instance and [timeStamp] > @date End Return @stepIds END Thank you!JCD

saving a text file in ms access data base

i have to read a text file in a text box then have to save it into ms access data base in column format how could i do this....

hide gridview column using javascript. working in ie and firefox but In firefox, gridview data is sh


function EnableDisableGridViewColumn() {
               var AdvanceSearch = document.getElementById('<%= chkboxlist1.ClientID %>');
               var chkList = AdvanceSearch.getElementsByTagName("input");
               var dgTest = document.getElementById("gridview1")
               if (dgTest != null)
                   for (var i = 1; i < dgTest.rows.length; i++) {

                       if (chkList[0].checked == true && chkList[1].checked == true) {
                           dgTest.rows[0].cells[0].style.display = "block";

Saving Data from Excel


Can someone point me in the right direction.

I need the ability for a user to browse to an Excel sheet stored on his local machine and save the contents into a database table.


Status of Accessing Nested Objects in Data Source of Local Report Does Not Function


We recently upgraded out platform to .NET 4.  We are also using Microsoft Reporting dlls.  Unfortunately, we found that the upgrade broke all of our reports.  Researching the cause, we found this article:


It seems that this issue has been open for some time now and I have not seen a good workaround (except for the shim class which is not really feasible for us).  Can I please get a status update for this?  Is there some other type of resolution?

Thank you,

Benjamin Strum 

Ben Strum

Saving arabic data in sql server


Hello, I have a multilanguage system, where i want to save both arabic and english data, so when inserting or updating arabic data, I am using N, but when i am inserting, it is still saving ???? while updating it is being saved properly.

Please could you advise why the update statment is working while on the other hand the insert is not.




Saving Data In Client Machine


Hi Guys,

I developed an application in Asp.net. It is a receipting system. I have deployed the system in a company which runs with various networks. The company uses VPN, LAN and so many. When I deployed the system they complain the speed is very slow when accessing through network. Specially in the receipt page where i have used Update Panels and AJAX Comboboxes, they complain that it takes time to load the combo boxes. Also they say that when the selected index is changed in the combo box, it takes time to post the data in the other relevant controls.

Now my main concern is to speed up the system? Can anyone help me to improve the speed? its really urgent. Please spot me out where the problem exists.

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