|
Hi change ur rowindex value or empid value after that u will get other wise reply to me i will give code for u ..
Reg
Nantha
|
|
|
|
|
Hi,
Set e.EditEndex=-1 After deleting the row.
Naresh Patel
|
|
|
|
|
thanks your guidance.
can u send me code please
|
|
|
|
|
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int empid=0;
empid = Convert.ToInt32(GridView1.DataKeys[e.RowIndex]);
cmd = new SqlCommand("delete employee where empid='" + empid + "'", con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
e.EditIndex=-1;
}
Naresh Patel
|
|
|
|
|
Hi try this ...
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int n = Convert.ToInt32(GridView1.DataKeys[e.RowIndex]);
int empid=n-1;
cmd = new SqlCommand("delete employee where empid='" + empid + "'", con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
in case not working send full functionality about this grid view process
|
|
|
|
|
I am giving you only Idea, not implementation.
Ok
Naresh Patel
|
|
|
|
|
very thank you Naresh Patel
|
|
|
|
|
Hi friends
I want to display reverse fileUpload control.I mean,normally fileupload display first textBox and One Button to browse file.I want to display first Button and then Textbox.
Is it possible?
Thanks in advance
Pathan
---------------------------------------------------
|
|
|
|
|
Imran Khan Pathan wrote: Is it possible?
Yeah. It is possible. there is a trick for it.
1. Add one button (let's say btnUpload) and textbox (txtPath) in your page.
2. Add HTML "input=File"
3. Make this "file" control as invisible. (CSS: opacity or alpha )
CSS - Code
<br />
filter:alpha(opacity=50);<br />
-moz-opacity:0.5;<br />
opacity: 0.5;
4. Write a JS function to fire the click event of input "file" control.
function fireFileClick()<br />
{<br />
var objfile = document.getElementById('myFile');<br />
objfile.click();<br />
<br />
var objTextBox = document.getElementById('txtPath');<br />
objTextBox.value = objfile.value;<br />
}
5. Add this function on click event of button "btnUpload"
<input type="btnUpload" onclick="fireFileClick();" <br />
value="Upload File" >
That's all..
Please follow the steps that I mentioned. Let me know the result.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hi Michael
Thanks for ur response.
I have done it.Its working fine in IE7 but I am not getting Click Event of Button In mozila.
whats a problem?
Thanks again
Pathan
---------------------------------------------------
|
|
|
|
|
Try this code ~
----------------------------------
<!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>
<title>Untitled Page</title>
<style type="text/css">
.file{
filter:alpha(opacity=0);
-moz-opacity .0;
opacity: 0.0;
position:absolute;
left: -150px;
}
</style>
<script language="javascript" type="text/javascript">
function fireFileClick(){
var objfile = document.getElementById('myFile');
objfile.click();
var objTextBox = document.getElementById('txtPath');
objTextBox.value = objfile.value;
}
</script>
</head>
<body>
<input id="myfile" type="file" class="file" />
<input type="button" id="btnUpload" value="Upload" onclick="fireFileClick();" />
<input type="text" id="txtPath" />
</body>
</html>
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
look michael I want to use this trik in my web side but the page is including master page and i want to use fileupload not input upload i tried it but it gives me some errors i'll post you the code to see it and if you could help me i will be grateful to you
the code
<%@ Page Language="C#" MasterPageFile="~/admin/MasterPage1.master" AutoEventWireup="false" CodeFile="~/admin/decleration_edit.aspx.cs" Inherits="decleration_edit" Title="تعديل كلمة الوزير" StylesheetTheme="style1" Theme="style1" %>
<asp:content id="Content1" contentplaceholderid="ContentPlaceHolder1" runat="Server">
<asp:fileupload id="FileUpload1" runat="server" enabletheming="True">
<asp:button id="Button1" runat="server" onclientclick="fireFileClick()"
="" text="تصفح....." onclick="Button1_Click">
<asp:textbox id="TextBox1" visible="false" runat="server" height="16px" style="right: 23px; position: relative;
top: 2px" width="152px">
thx
let's work together |
|
|
|
|
|
Hi ahmed_fci2006,
Can you post your code again with "Ignore HTML tags in this message" checked? I can't see your code clearly..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
<%@ Page Language="C#" MasterPageFile="~/MasterPage2.master" AutoEventWireup="false" CodeFile="final.aspx.cs" Inherits="test_Default" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript">
<!--
<!--
function fireFileClick()
{
var objfile = document.getElementById("<%= File1.ClientID %>");
objfile.click();
var objTextBox = document.getElementById("<%= Text1.ClientID %>");
objTextBox.value = objfile.value;
}
</script>
<br />
<asp:FileUpload ID="File1" runat="server" />
<br />
<asp:Button ID="Button1" OnClientClick="fireFileClick()" runat="server" Text="ASPNET Button" />
<input id="Text1" type="text" runat="server" />
<br />
<br />
<input id="Button2" type="button" onclick="fireFileClick()" value="HTML Button" />
<br />
<br />
</asp:Content>
let's work together
|
|
|
|
|
what is the code for recurrence(reminder) in calendar....
Recurrence means repeating activity periodically...
Daily, Weekly, Monthly, Yearly
System will ask for start and end time each interval types.
System will have option to select a day e.g. every Friday - Weekly interval
System will have option to select a date e.g. every 15th - Monthly interval
System will have option to select a date and month e.g. very 15th of June - Yearly interval
|
|
|
|
|
1. Read the forum guidelines.
2. Give your messages titles with meaning.
3. Do you own homework.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
I'm new in asp
so I started with downloading IIS 6.0 from internet, then I installed it on my system.. anyways , install is succesfull, but IIS doesnt appear on my services list.. It must be very simple but I would appreciate if sbody does help me..
|
|
|
|
|
methhoo wrote: I started with downloading IIS 6.0 from internet
Say what?
The IIS version that you should use is on your Windows disk. You can't install any other version of IIS than the one intended for your version of Windows.
(There is a possibility to hack Windows, so that it's possible to install an IIS version from a different Window version, but if you are doing this, you are pretty much on your own. You can't have found a description of how it's done without seeing the warning that it's totally unsupported, and may make your system instable.)
methhoo wrote: then I installed it on my system
Eh... How? Are you sure that it's really IIS that you downloaded, and not something completely different? Like a trojan?
methhoo wrote: install is succesfull, but IIS doesnt appear on my services list
Then I wouldn't call it successful...
---
single minded; short sighted; long gone;
|
|
|
|
|
Hello guys,
I'm struggling a problem now for some days. Hopefully one of you guys can help me out with that.
I wrote my own VirtualPathProvider and VirtualPathFile to make it possible to load different pages from different locations. It works very good. But now I need to load the pages from different locations depending on a value stored in the session. The time when VirtualPathprovider is invoked the Session object is not available or lets say it's available but null.
Now I found out that the session object is filled when the AcquireSessionState event is invoked, but thats to late for me because the action of loading the page already passed. So now I want to create the session by my own before the AcquireSessionState is invoked. But I don't know how to fill the session object by my own.
Does anybody can help me with this problem? Or has anybody a better idea then filling the session object by my own.
Thanks a lot for any input
Oliver
|
|
|
|
|
A thought!..Can you use cookieContainer!! or HttpApplication instance!!
|
|
|
|
|
Hi,
Thanks for the input, but I use cookieless sessions.
I tried to retrieve session data from different locations:
HttpContext.Current.Session - null at this time
HttpContext.Current.ApplicationInstance.Session - null at this time as well
I guess thats because the AcquireSessionState is called later on - where the session object is filled.
What I want to do now is to try initialize the Session earlier, but I don't know if it's possible.
Thanks
Oliver
|
|
|
|
|
Hi peacefulmember,
I have to apologize. I use cookies without my knowledge
Now that I know that I use cookies I found out that there is a cookie in which the session id is stored. I save now the value which I wanted to store in the session also in the cache with following statement:
<br />
Cache[Session.SessionID + "_MyKey"] = Value;<br />
The difference to just saving it in the session is that the cache is available every time and the cookies are already present at the time I need to get the value. So in my VirtualFile I added following code to retrieve the value again:
<br />
if (HttpContext.Current.Request.Cookies["ASP.NET_SessionId"] != null) {<br />
value = (String)System.Web.Hosting.HostingEnvironment.Cache[HttpContext.Current.Request.Cookies["ASP.NET_SessionId"].Value + "_MyKey"];<br />
}<br />
That solved the problem for me. It's kind of a workaround. I would have preferred the "Session-Solution" but as the Session is not filled that time I have to solve it this way.
Thanks
Oliver
|
|
|
|
|
I have user control with some standard HTML tags. On one of my HTML button tag I want to perform a javascript validation (a Hello test function for now).
I cannot figure out how can I trigger this function from with in my user control on this HTML button tag click event or on usecontrol's click event.
Thanks in advance.
Partial Class MyUserControl
Inherits System.Web.UI.UserControl
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim js As StringBuilder = New StringBuilder()
js.Append("<script language=JavaScript>")
js.Append("function Hello() { ")
js.Append(" alert ('Hello'); }")
js.Append("</script>")
If (Not Page.ClientScript.IsStartupScriptRegistered("MyScript")) Then
Page.ClientScript.RegisterStartupScript(Me.GetType(), "MyScript", js.ToString())
End If
End Sub
End Class
|
|
|
|
|
Sorry, I messed up the subject earlier. But I meant to wish everybody. HI.
|
|
|
|
|
The easiest way is to use a custom validator, which can be made to call any function you like.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|