|
hi ritu
try this code:-
Set commandname and CommandArgument property of Button
<asp:Button ID="BT" runat="server" Text="Button" CommandName="Botton" CommandArgument='<%# Eval("fileid") %>'/>
protected void GV_items_RowCommand(object sender, GridViewCommandEventArgs e)
{
string fileid = Convert.ToString(e.CommandArgument);
//By this code u will get ur fileid
}
pathan
|
|
|
|
|
we cannot take button in gridview in this way. IT gives error .
Error 1 System.Web.UI.WebControls.DataControlFieldCollection must have items of type 'System.Web.UI.WebControls.DataControlField'.'asp:Button' is of type 'System.Web.UI.WebControls.Button'.
|
|
|
|
|
Try the code which I gave as I am doing this only and its working in my Project. The only difference is that I am using image button and u r using button.
|
|
|
|
|
Hi ritu
u can take server bottun between <ItemTemplate> tag.
i give u whole code how to take a button
now try this code
<asp:GridView ID="GV_cart" runat="server" AutoGenerateColumns="False"
OnRowCommand="GV_cart_RowCommand" CellPadding="4" ForeColor="#333333">
<Columns>
<asp:BoundField DataField="fileid" HeaderText="File Id" />
<asp:BoundField DataField="Filename" HeaderText="File Name" />
<asp:TemplateField>
<HeaderTemplate>File id</HeaderTemplate>
<ItemTemplate>
<asp:Button ID="BT" runat="server" CommandName="button" CommandArgument='<%#Eval("fileid") %>' Text="Button" Width="75px" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
After this write code on Row_command event
if (e.CommandName == "button")
{
string fileid= e.CommandArgument.ToString();
}
if u use more than one button than this code may be useful for checking which button evet fires by commandname condition.
Pathan
|
|
|
|
|
thanks . had worked .thanks to varsha mane too.
|
|
|
|
|
|
How to call webservice without adding webreference in solution
|
|
|
|
|
Web Method from Web Service can be invoked by using HTTP POST. so, you can submit the Form with POST to a particular web method..
The way we are using in our project. we generate a proxy class by using wsdl. and just add this proxy class to web project. then, we can invoke to the webmethod via this proxy class..
here is also another way to invoke a web service without web reference.
http://www.codeproject.com/cs/webservices/CallWebServicesDynamic.asp
Hope it would help.
|
|
|
|
|
hi I am reading xls file in that there are 5 column of date in dd/mm/yyyy format but while i am reading from code few of date column format is change.
i.e mm/dd/yyyy how to fix this problem
|
|
|
|
|
Dear All,
I have made web application using Asp.net C#(Visual Studio2005). And I used Publish Web site option. Now I want to make web setup. I select New -> project -> SetUp and Deployement ->
There I given name of the setup and location of project file.When I click Ok. File System Web setup open. Now when i goes for add project output from web application project. I do not get any option
I even tried location of project to published web site location but it did not work out
Please help..
thanks
regards
imran khan
|
|
|
|
|
i am using xml to import data to my web page. Information is displaying but xsl style sheet is not applying please tell me, whats the problem .... Please my code is :
Dim xmlPath As String = Server.MapPath("XMLFile.xml")
Dim xslPath As String = Server.MapPath("XSLTFile.xsl")
Dim fs As FileStream = New FileStream(xmlPath, FileMode.Open,FileAccess.Read)
Dim reader As StreamReader = New StreamReader(fs, Encoding.UTF8)
Dim xmlReader As XmlTextReader = New XmlTextReader(reader)
'Instantiate the XPathDocument Class
Dim doc As XPathDocument = New XPathDocument(xmlReader)
'//Instantiate the XslTransform Class
Dim xslDoc As XslCompiledTransform = New XslCompiledTransform()
xslDoc.Load(xslPath)
Dim sw As StringWriter = New StringWriter()
xslDoc.Transform(doc, Nothing, sw)
' //Close Readers
reader.Close()
xmlReader.Close()
Response.Write(sw.ToString())
Please help me...
Feroze
|
|
|
|
|
Hi Feroze!
Why aren't you using the XML-Control (found in the Toolbox)?
With this you just need to apply the XML-Source and the transformation file.
e.g:
Dim xmlDoc As New XmlDocument()
xmlDoc.Load("your path to the xml-data goes here")
With yourXmlControl
.Document = xmlDoc
.TransformSource = "your path to the xsl-file goes here"
End with
This is all what needs to be done.
- walter
|
|
|
|
|
I am currently using a shared server with discount ASP.
I want to know if anyone of you have better experience in term of speed and efficiency with other webhosts.
please share your views
|
|
|
|
|
This site gives better performance and have much better features.
http://www.m6.net
|
|
|
|
|
|
|
Please give some details.
|
|
|
|
|
sorry about that.
i am developing a project that needs to store the encrypted admin password in a separate file (admin.xml). this file is located in wwwroot/project/bin/FILES/
this works fine until the user changes the password, in which case the password is saved in the "admin.xml" file.
after the file update, the session expires
i can't figure out why?
the password changing page is at the location wwwroot/project/GUI/chPassword.aspx
any suggestions?
thanks in advance.
|
|
|
|
|
I'd like to know whether it is possible to set different HeaderStyle for different columns in Gridview. I tried to put headerstyle cssclass tags in different columns. But this method is not working. Is there a way to do it?
Thank you so much in advanced
bin bin
|
|
|
|
|
i think this will work or you can also add it dynamically at ItemDataBound event.
< asp:BoundColumn HeaderText="Heading1" >
<HeaderStyle CssClass="class1"></HeaderStyle>
< /asp:BoundColumn >
Regards
Shajeel
|
|
|
|
|
Thanks for your reply.
It tried to define it in the asp:BoundColumn. But it seems the header style defined in the column won't override the style of the whole header. Should I use z-index to make it work?
The header style defined for column is not working at all.
Thank you again.
|
|
|
|
|
it is overriding for me when i am using both Header Style on Grid and Header Style on individual columns.
Regards
Shajeel
|
|
|
|
|
Hi,
I have a strange problem that I could use some help with.
Using Visual Web Developer I have a solution using ASP2 that has a master page with one content pane. I then:
- added a webform to my solution based on the master page. This is Default.aspx
- added a label to the content pane of Default.aspx
- set the text property of the label to be "Line1 Line2"
Running the page in the browser shows BOTH lines on the same line (1st line), i.e. the second line is written over the first line.
I then added another webform to the solution but did not base it on the master page. To this webform I added a label and set the text property to "Line1-no-master Line2-no-master". This works fine. On line 1 I get the text "Line1-no-master" and onthe line below is the text "Line 2-no-master".
Question is, why does the master page based solution above not work? Is there a known workaround or a solution that someone can suggest?
I'm tearing my hair out over this....!!!
All help appreciated..
Thanks,
|
|
|
|
|
Hello ...
I am creating a website using asp.net1.1(visual studio2000 with C# code) and Sqlserver2000 ...
I want to create a place so that the admin can post a message ( like posting message here) ... I need a text editor,like adding smiley,changing font ( formatting)... How can I do it...?
please help me.
thank a lot dear friends.
|
|
|
|
|
You can take this textbox as an example. Assign some values for each and every smileys and while storing or sending attach the smileys.
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|