|
Implement it in Item template column
<a Target="_blank" href='filepath' ></a>
Parwej Ahamad
|
|
|
|
|
Thnxs for answering it.
But can u give some more idea about it. Mean let i have a dataset which containt those file. So now tell me how can attach it to datagrid cell as a link?
Arun Sahoo
|
|
|
|
|
What he was mentioning is to create a template column and put the hyperlink control in it. Now you can assign whatever you want to that control.
Apurva Kaushal
|
|
|
|
|
In my application, i have a 2 dropdowns , textbox and checkbox. On select of checkbox,
I should enter enter value from first dropdown and second dropdown and also a value can be entered in the
textbox.
The checkbox is for default value, if it is checked, I should enter a value to textbox.
Everything works fine now. But when i enter these values and click save, it takes value from first and second dropdowns
and saves to database. I need the textbox value to be entered into grid and say the value in grid should display as follows
Example :
if i select customername from first dropdown
and customeraccountname from second dropdown
then check default checkbox, enter value in textbox as 24
the grid value saved should be displayed as
Column 1 Column2
-------- --------
Customername 24[Default]
The second column value is displaying as Customeraccountname only....
Any help would be thankful...
SAJAN A PILLAI
ASP.NET,C#.NET Programmer
BANGALORE
"Winners don't do different things. They do things differently. ...
|
|
|
|
|
sajan ss wrote: ASP.NET,C#.NET Programmer
Hmm.....
sajan ss wrote: Customername 24[Default]
I'm not sure I understand. You say it's saving fine, so what bit do you need to add ? The word default by the number ? What is it you're having trouble with exactly ? You've defined your need OK, but then you've said 'everything works fine now'. So, what's the issue ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I need the second column value to be displayed in the way I said.
It showing as
CustomerName and CustomerAccountName now....
I want it to be in
CustomerName and 24[Default]
SAJAN A PILLAI
ASP.NET,C#.NET Programmer
BANGALORE
"Winners don't do different things. They do things differently. ...
|
|
|
|
|
Is 24 the account name ? I think you're saying you need to check if the textbox has a value, and if so, to insert that, but the task is so trivial and your explanation so longwinded, that I really don't know what the issue is
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Are you writing JavaScript on Check-Uncheck of Check Box ?
It seems somewhere you are assigning wrong values,
Try to Debug the code and find out where wrong values are getting assigned to Value in the grid
|
|
|
|
|
Did you try to do it yourself? Or want some one do things for you. Did you written any line of code?
|
|
|
|
|
Hi Everyone
I'm new to ASP.NET and am having trouble with my project. I am building it using Visual Web Developer 2008 Express. Language C#.
I have a gridview linked to a LinqDataSource. I want to add a search facility to the gridview as the database that is linked to it contains a lot of entries.
I downloaded the code from your site for the control to do this and altered everything to meet my specifications. Everything seems to work except that the gridview still remains the same with the original entries showing instead of showing the filtered entries.
The gridview shows four columns from the database table.
Hope someone out there can she some light on this as I'm pulling my hair out.
Thanx in anticipation
Andy
My code behind code is this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
public partial class Controls_PinsSearch : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void lbtnBasicSearch_Click(object sender, EventArgs e)
{
string sSearchText = GetBasicSearchString();
OnSearch(sSearchText);
lbtnCancelBasicSearch.Visible = true;
}
protected string GetBasicSearchString()
{
StringBuilder sb = new StringBuilder(string.Empty);
string sBasicSearchText = txtBasicSearch.Text.Trim();
if (sBasicSearchText == string.Empty)
return string.Empty;
string sFirstName = GetSearchFormattedFieldString("FirstName", sBasicSearchText, string.Empty, true);
sb.Append(sFirstName);
sb.Append(" OR ");
string sLastName = GetSearchFormattedFieldString("LastName", sBasicSearchText, string.Empty, true);
sb.Append(sLastName);
sb.Append(" OR ");
string sPinCode = GetSearchFormattedFieldString("PinCode", sBasicSearchText, string.Empty, true);
sb.Append(sPinCode);
sb.Append(" OR ");
string sFilter = GetSearchFormattedFieldString("Filter", sBasicSearchText, string.Empty, true);
sb.Append(sFilter);
sb.Append(" OR ");
string sSearch = sb.ToString();
return sSearch;
}
protected string GetSearchFormattedFieldString(string sfield, string value, string soperator, bool bForceStringType)
{
if (value.Trim() == string.Empty)
return string.Empty;
string _newValue = value.Trim();
string _operator = "=";
if (soperator != string.Empty)
_operator = soperator;
if (bForceStringType == false)
{
}
return _newValue;
}
public delegate void SearchEventHandler(string _SearchText);
public event SearchEventHandler Search;
protected virtual void OnSearch(string _SearchText)
{
if (Search != null)
{
Search(_SearchText);
}
}
protected void lbtnCancelBasicSearch_Click(object sender, EventArgs e)
{
txtBasicSearch.Text = string.Empty;
OnSearch(string.Empty);
lbtnCancelBasicSearch.Visible = false;
}
}
The markup code for the control is:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="PinsSearch.ascx.cs" Inherits="Controls_PinsSearch" %>
<asp:Panel ID="pnlBasicSearch" runat="server" Width="100%">
<table>
<tr>
<td>
<asp:Label ID="lblBasicSearch" runat="server" Text="Search for:" ></asp:Label>
</td>
<td>
<asp:TextBox ID="txtBasicSearch" runat="server" Text="" MaxLength="50" Width="255px" />
</td>
<td>
<asp:LinkButton runat="server" ID="lbtnBasicSearch" CausesValidation="False" Text="Search" OnClick="lbtnBasicSearch_Click" />
</td>
<td>
<asp:LinkButton runat="server" ID="lbtnCancelBasicSearch" CausesValidation="False" Visible="false" Text="Cancel" OnClick="lbtnCancelBasicSearch_Click" />
</td>
</tr>
<tr>
<td colspan="2" align="right">
</td>
<td colspan="2"></td>
</tr>
</table>
</asp:Panel>
|
|
|
|
|
I don't see the actual search method that does the work here. Have you stepped through the code in the debugger to see what happens ? Are you hooking your delegate up to a method that actually does a search ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thanx for the reply Christian.
As I said before I am new t ASP.ET. How do I use the debugger and what is a delegate?
Andy
|
|
|
|
|
Well, it seems you're in way over your head.
1 - you set a breakpoint with F5, then the program stops at that point and you can step through to see what happens
2 - as you don't know what a delegate is, I assume you copied and pasted this code, which by itself, can never work. A delegate is a function pointer. Your code tries to call a delegate to do the actual search., and if you didn't hook one up, no search will occur.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thanx for the advice Christian.
Yes I think I am in over my head.
I have just been learnig asp.net. Everything is working fine and I just need to be able to do a search by entering text and displaying the results in a gridview but thanx for the help
Andy
|
|
|
|
|
All of this code is far too much - all you need is SQL to do the search and take the search term, and then to call that SQL to get the result to bind to your grid.
So a stored proc that takes a parameter and that's the search term, then use that if you have a search term or if you do a LIKE search, then it will work even if the string is empty.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
hi;
i am doing a home automation project, through which i am controling home appliances with a PC(Serial port[microcontroller circuitry]), i want the Pc at home to be accessed remotely so that i can remotely send on/off commands on the "serial port" of the pc at home so how can it be done?
fahad
|
|
|
|
|
Definately not using ASP.NET. Perhaps using a webservice ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
You are in Wrong Forum
|
|
|
|
|
Hey guys..
I have a dropdownlist and , depending on the selected item , i want to dynamically add some textboxes and labels.
The labels are not a problem , but i can't retrieve the text from the textboxes . I read that they should be initialized
in Page_OnInit , but it does not work (or i'm wrinting the wrong code) .
Can you please tell me what to do , and if it's about the Page_OnInit , can you just show me a piece of code using it ?
Thank you !
|
|
|
|
|
TerRO_GirL wrote: I read that they should be initialized
in Page_OnInit
You read that where? When you are working off articles or examples and have a question relating to that work, post a link to it along with your question, so we can see what you are attempting to understand.
led mike
|
|
|
|
|
i don't find that relevant . I would google it right now , but a snail would be much faster than my internet connection right now . There are forums and hints saying that the dynamically created controls should me initialized in the Page_OnInit . If that's right , give me an example please, if not , just tell me what to do
|
|
|
|
|
TerRO_GirL wrote: i don't find that relevant .
Ok, good luck
led mike
|
|
|
|
|
dude, that was rude .
I took me 10 minutes to read your post and anothet 10 to post this back . I'll give you the links (if you so find them relevant) when i'll get a better connection .
|
|
|
|
|
|
TerRO_GirL wrote: I'll give you the links (if you so find them relevant)
YOU WILL?! That's great because I'm the one that needs the help here. Oh wait.
TerRO_GirL wrote: dude, that was rude .
"Ok, good luck" qualifies as rude? Maybe you should stop smoking crack.
led mike
|
|
|
|