Click here to Skip to main content
       

ASP.NET

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
QuestionFindControl not working in Gridview ItemTemplate of ButtonmemberMember 974870717 Jan '13 - 19:42 
The findcontrol event is not getting the control e.g. "btnSubmit" placed inside a gridview itemtemplate tag.
please help with code in VB.NET
AnswerRe: FindControl not working in Gridview ItemTemplate of Buttongroupchester_it2118 Jan '13 - 6:16 
<ItemTemplate>
 <asp:CheckBox ID="chkItemSelect" runat="server" />
 <asp:Label ID="lblname" Text='<%#Bind("name")%>' runat="server" />              
<asp:Button ID="btnFindx" runat="server" CommandName="Findx" Text="Do Some thing" CommandArgument='<%#Eval("ID")%>'></asp:Button>
                                        </ItemTemplate>
 
So, in event OnRowCommand(Code Behind) :
 
Protected Sub GridView_RowCommand(sender As [Object], e As GridViewCommandEventArgs)
	Select Case e.CommandName
		Case "Findx"
			MethodFindControlValue()
			Exit Select
	End Select
End Sub
 
..in MethodFindControlValue() :
Private Sub MethodFindControlValue()
	For Each row As GridViewRow In ApprovalGrid.Rows
		Dim chkItemSelect As CheckBox = CType(row.FindControl("chkItemSelect"), CheckBox)
		Dim chkItemSelect As Label = CType(row.FindControl("lblname"), CheckBox)
 
		Dim id As String = Convert.ToString(NameGridView.DataKeys(row.RowIndex).Value.ToString())
	Next
End Sub
 
 

hope this help you............Big Grin | :-D
QuestionRe: FindControl not working in Gridview ItemTemplate of ButtonmemberNandakishorerao18 Jan '13 - 21:48 
paste the code what you have done till now?..so that we can help you in correcting the errors.
AnswerRe: FindControl not working in Gridview ItemTemplate of ButtonmemberKanwal Daud Gill21 Jan '13 - 20:23 
Thanks for the help dear!
but my case was solved as I used the LINK BUTTON instead of button in the itemtemplate tag of Gridview
GeneralRe: FindControl not working in Gridview ItemTemplate of ButtonmemberNandakishorerao21 Jan '13 - 20:49 
ok...sure...enjoy coding...all the best..
QuestionTracking EmailsmemberJaison Joe17 Jan '13 - 17:49 
How to track emails whether the receiver has read the message and reply us in asp.net...
Questionhow to redirect in a url?memberJassim Rahma17 Jan '13 - 9:42 
I am using this to redirect to comment page:
 
Response.Redirect(String.Format("~/{0}/Comment/{1}", Page.RouteData.Values["ADDRESS"], Page.RouteData.Values["GUID"]), false);
 
I want, if the user is not signed in to redirect to /signin but with mentioning the original page so when user signs ij it will automatically redirect to the original page. something like:
 
if (Session["volow_member_id"] == null || Session["volow_member_guid"] == null)
{
    Response.Redirect("~/Signin/" + String.Format("~/{0}/Comment/{1}", Page.RouteData.Values["ADDRESS"], Page.RouteData.Values["GUID"]), false);
}
else
{
    Response.Redirect(String.Format("~/{0}/Comment/{1}", Page.RouteData.Values["ADDRESS"], Page.RouteData.Values["GUID"]), false);
}
how can i do this?

 
Technology News @ www.JassimRahma.com

AnswerRe: how to redirect in a url?memberParwej Ahamad18 Jan '13 - 7:17 
Put your return url into the query string and after login check if you have return url query then to that url or redirect to default page
 
?ruturnur=your urllllllllllll
Parwej Ahamad
 

 

GeneralRe: how to redirect in a url?memberJassim Rahma18 Jan '13 - 7:36 
but my signin url is :
 
mydomain.com/signin
 
and the redirect url is:
 
mydomain.com/myprofile/comment/post-guid-string
 
so the full url would be something like this (because I am usilg url route mapping):
 
mydomain.com/signin/www.mydomain.com/myprofile/comment/post-guid-string
 
which is invalid!

 
Technology News @ www.JassimRahma.com

GeneralRe: how to redirect in a url?memberParwej Ahamad18 Jan '13 - 17:23 
No Url will be:
 
mydomain.com/signin/?returnurl=www.mydomain.com/myprofile/comment/post-guid-string
Parwej Ahamad
 

 

AnswerRe: how to redirect in a url?memberRekhash18 Jan '13 - 23:01 
protected void Page_Init(object sender, EventArgs e)
{
Response.Redirect("~/yourpage.aspx");
}
QuestionHow to add KML file to google Map using javascript in asp.netmemberTrivikramarao Vurubandi17 Jan '13 - 0:40 
How to add KML file to google Map using GGeoXml in javascript in asp.net
QuestionExport data in Excel(xlsx) without using Excel Object from Datatable.membermca_rameshkumar16 Jan '13 - 22:00 
I tried using oledbconnection with excel and exported data into it but it doesn't support on 64bit.
In 32bit it works well.
But in 64bit it works partially.
 
Can you give me any solution...
AnswerRe: Export data in Excel(xlsx) without using Excel Object from Datatable.groupchester_it2118 Jan '13 - 6:52 
Redirect/open window to pageListForExportExcel.aspx in page1.aspx
so in page1 set input button to redirect/open window to pageListForExportExcel.aspx
in page1 :
 
<input type="button" value="Export to Excel" onclick="ExportToExcel()"/>

and you need javascript or JQuery for create function redirect/open window to pageListForExportExcel.aspx
 
  <script type="text/javascript">
  		function ExportToExcel() 
		{
			var txt = window.open("pageListForExportExcel.aspx");
		}
  </script>
 

in ASPX (pageListForExportExcel.aspx), use repeater for display you data from datatable,Example set to be this :
<%@ Page Language="C#" AutoEventWireup="true" EnableSessionState="ReadOnly" EnableViewState="false" CodeBehind="BukuInduk_exportToExcel.aspx.cs" Inherits="LimSys.Web.Laporan.BukuInduk_exportToExcel" %>
		<asp:Repeater ID="rep1" runat="server">
			<HeaderTemplate>
				<table border=1>
					<tr>
						<td>NAME</td>
						<td>ADDRESS</td>
						<td>TELP</td>
						<td>GENDER</td>
					</tr>
			</HeaderTemplate>
			<ItemTemplate>
					<tr>
						<td><%# Eval("name")%></td>
						<td><%# Eval("address")%></td>
						<td><%# Eval("telp")%></td>
						<td><%# Eval("gender")%></td>
					</tr>
			</ItemTemplate>
			<FooterTemplate>
				</table>
			</FooterTemplate>
		</asp:Repeater>
 
and the last,in code behind pageListForExportExcel.aspx.cs
use this :
 
         protected void Page_Load(object sender, EventArgs e)
        {
            Response.Clear();// this for clear any response
            Response.Buffer = true; // and then set to Buffer is true
            Response.ContentType = "application/vnd.ms-excel";// and this is for call type what you want to set File extention for save....you can export to pdf ,if you change value Response.ContentType

            var process = new DataLayersCollections();//set here by name your BusinesLogic
            var list = process.GetListFromDataTable(); //set here by name your functions  
            rep1.DataSource = list;
            rep1.DataBind();
        }
 
and the latter again .......
good luck ....
hope this help you.....Big Grin | :-D
QuestionButton or ImageButton?memberJassim Rahma16 Jan '13 - 9:40 
Hi,
 
I would like to ask which way you prefer to get a button in ASP.NET project? Button or ImageButton?

 
Technology News @ www.JassimRahma.com

AnswerRe: Button or ImageButton?memberjkirkerx16 Jan '13 - 12:40 
You use buttons because it's faster and easier, just apply a css style to them.
 
You use image buttons to obtain a certain look and feel for an app, or for something that cant be described by words.
 
In more advanced cases, you use span tags with css style, or images and bind them to an event in Javascript or Jquery.
QuestionGoogle Translate vb.netmemberDotNetFellow15 Jan '13 - 22:31 
hi
 
Has anyone got a good sample code on Google Translate V2 using vb.net? Thanks
AnswerRe: Google Translate vb.netmvpSandeep Mewara16 Jan '13 - 2:57 
Did you try Google[^]? Try once, you might get surprised.
One of the articles on it: Google Translator API v2 Implementation[^]
Sandeep Mewara
Microsoft ASP.NET MVP 2012 & 2013
 

[My Latest Article(s)]:
How to extend a WPF Textbox to Custom Picker
Server side Delimiters in ASP.NET

Questionunzipping file in host ?memberjojoba201115 Jan '13 - 17:59 
Hi world !
I have this php code for unzipping file in server host.
<?php  
$zip = new ZipArchive;  
$res = $zip->open('6.zip'); 
if ($res === TRUE) {   
$path = pathinfo(realpath('6.zip'), PATHINFO_DIRNAME); 
$zip->extractTo($path); 
$zip->close();  
echo 'ok';  
unlink('UnzipViaPhp.php');  
} else { 
echo 'failed'; 
}  
?> 
So now i wanna ASP.NET code for unzipping the file on server host .(Something like the php one).
AnswerRe: unzipping file in host ?memberVani Kulkarni16 Jan '13 - 2:44 
Check this link,
How to unzip file in c#.net[^]
Thanks & Regards,
Vani Kulkarni

QuestionRe: unzipping file in host ?memberjojoba201116 Jan '13 - 7:41 
thanks for solution . but none of them worked on Host. cause its on internet and doesnt worked !
QuestionProblem with MapPageRoute..memberJassim Rahma15 Jan '13 - 10:06 
Hi,
 
Why I am getting object reference not set to an instance of an object with the following MapPageRoute?
 
I guess it's because of {ADDRESS} at the beginning without a name like Page/{ADDRESS{ but how can I solve it. I already sent all the three lines at the end of the MapPageRoute but still having the same problem, keep in mind the problem occuers only in the PostComment.aspx
 

<pre lang="cs">routes.MapPageRoute(&quot;volow_member_channel_post&quot;, &quot;{ADDRESS}/{GUID}&quot;, &quot;~/Post.aspx&quot;);
routes.MapPageRoute(&quot;volow_channel_home&quot;, &quot;{ADDRESS}&quot;, &quot;~/ChannelHome.aspx&quot;);
routes.MapPageRoute(&quot;volow_member_post_comment&quot;, &quot;{ADDRESS}/Comment/{GUID}&quot;, &quot;~/PostComment.aspx&quot;);</pre>

 
Technology News @ www.JassimRahma.com

AnswerRe: Problem with MapPageRoute..mentorBrij15 Jan '13 - 17:30 
Can you reframe your question and your post is not looking proper. Please correct it.
Cheers!!
Brij
Microsoft MVP ASP.NET/IIS
Visit my Blog: http://brijbhushan.net

AnswerRe: Problem with MapPageRoute..mvpRichard MacCutchan15 Jan '13 - 23:02 
Jassim Rahma wrote:
object reference not set to an instance of an object
You should understand that this error means that you are using a reference that does not refer to anything, i.e. the reference is null or not initialised. In your code your are using the reference routes so it is reasonable to guess that routes has not been set up correctly, or has been corrupted.
One of these days I'm going to think of a really clever signature.

Questionhow to install downloaded nested master page template???memberMember 876986514 Jan '13 - 3:25 
i am using visual studio 2008. there is no nested master page template in add new item--> template list

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web01 | 2.6.130523.1 | Last Updated 25 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid