|
Give some more details of the problem. Whta i have understood is on click of a imagebutton(which is inside the datagrid) you want to display some more details of that record. If it is so then you can easily do that. What you need to do is to place the image button in the itemtemplate of the datagrid and handle the click event which you can do with onItemCommand event of the datagrid.
Best Regards,
Apurva Kaushal
|
|
|
|
|
I have a database with name, image, etc and as far as i know you cannot click on an image in a datagrid so i want to us the datagrid to show like thumbnails of the images, and when clicked, retrieve the the image and other data from the database and display it in detailsview using master/detail.
|
|
|
|
|
You can display the image in the datagrid and also can handle the click event of that image. But do you have your image saved in the database or only the image name which you are retreiving from the database and displaying the image from a certain location?
Best Regards,
Apurva Kaushal
|
|
|
|
|
To be honest, when i filled the database i can't remember whether the image is stored in the database or just the location address. What would be the difference?
Thanks for talking to me!!!!
|
|
|
|
|
There is too much difference, actually in normal case only the image name is being stored in the database and the image is being saved at some place at the server, so while retreiving only you have to get the name and attach it with the path of the image(where the image is stored) and display it. In the other case the complete image is being save into the database which is rather a bit complicated. You need to have separate datatype in the database to store the image. For details of how to save image to the database you can check this link:
http://www.codeproject.com/aspnet/PicManager.asp
Best Regards,
Apurva Kaushal
|
|
|
|
|
Thanks for the link. Iam using Sqlexpress for now and my code is in VB.Net and ASP.Net. Will this link still apply.
-- modified at 8:23 Tuesday 1st August, 2006
|
|
|
|
|
This example is there in VB.Net:
http://www.atalasoft.com/kb/article.aspx?id=10018
Best Regards,
Apurva Kaushal
|
|
|
|
|
Thanks for all your help Apurva, I will try all this when I am on my own computer.
Kind regards,
Ian
|
|
|
|
|
always welcome...
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hello All,
I am creating a custom control which has a capability to create controls as requested. It means, if I ask custom control to create one textbox and two dropdowns, at runtime it will create those and show.
Now I would like to have cascading dropdowns in custom control. Do anyone have an idea how to add a cascading dropdown [ATALAS TOOLKIT CONTROL] from code at runtime?
Any help appreciated.
Thanks in advance.
- ashish
|
|
|
|
|
I have a problem with CustomValidator. I want to validate 2 controls. IsValid=false when DropDownlist selected item (some value) and some textbox.text ="". I don't know how to write clientValidation script ( no javascript, no vbscript language experience ). Please help
StonePit
|
|
|
|
|
just add the custom validator to your page and set its ClientValidationFunction function to the name of a javascript function that will do the validation. You don't have to set its 'controltovalidate' property as you will be interogating 2 controls.
Put a section in the header of your page that defines the function you just referenced. In this function, use the DHTML DOM to grab the elements you are interested in and interogate them.
your javascript function would look something like:
function CustomClientValidate(source, arguments)
{
ddl_Items = document.getElementById('ddl_Items'); //note the string in getElem.. must match the clientid of your asp.net dropdown.
or
txt_myentryfield = document.getElementById('txt_myentryfield');
and then something like
arguments.IsValid=true
var itemSelected = false;
for (n = 0; !itemSelected && n < ddl_Items.items.count; n++)
if (ddl_Items.items[n].selected)
itemSelected = true;
if (txt_myentryfield.value == '' && !itemSelected)
arguments.IsValid=false;
}
I did not try to run any of this and I may not be remembering how to iterate the items in the drop down on the client (a select on the client), but you can look that up elsewhere. This is the generate idea.
|
|
|
|
|
Hi,
I have to draw a pie chart using webchart dll in asp.net.
I have two records with colA, colB. I have to plot colA vs colB. All the 4 values should be shown explicitly. (4 distinct pieces).
Can anybody help?
Thanks in advance.
Swaroop.
|
|
|
|
|
Hi,
Thanks Guffa for your suggestion, ("<[^>]+?>") this expression works fine, but still i need your suggestion how to to filter the tags leaving bold,itallic,underline tags??? i tried in your expression as ("<[^< b >>]+?>") perfectly, it works for bold, when i tried for ("<[^< u >>]+?>"),("<[^< i >>]+?>"), they does not works for certain tag but it leaves the < i > or < u > tag as i need.
(Plz avoid the spaces between the tags), to avoid confusion i put like that
Plz suggest me
Regards
Exelio
-- modified at 5:23 Tuesday 1st August, 2006
|
|
|
|
|
Continue in the same thread.
---
b { font-weight: normal; }
|
|
|
|
|
on page load i have to bind a datalist control in another datalist control.
|
|
|
|
|
In the page load you bind the first datalist and in the itemdatabound event of the parent datalist you bind the child datalist.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi Apurva,
thanks a lot ! The help worked out..!
To give the detail of the problem i have two tables ,Master and the Detail table.
I have to bind the Detail table in the inner datalist control.
Could you please guide me how to create relation with in the datalist controls?
|
|
|
|
|
Actually what you need to do is put the child datalist in the itemtemplate of the parent datalist and then as i told first bind the parent datalist and then on itemdatabound event of the parent datalist you first find the child datalist and then bind it. onitemdatabounf event fires for each and every record of the datalist and there you can get the associated child records for the parent ID. you can use filter for that.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Thanks Apurva!!
This is what is was looking for ..
Regards
Deepak
|
|
|
|
|
always welcome...
Best Regards,
Apurva Kaushal
|
|
|
|
|
how can i check the string that it has at least "@" sign
for example .......@hotmail.com
i must check that string starting with some text but must end with "@hotmail.com"
|
|
|
|
|
try with
int a = (string).IndexOf("@");
and check the value of a
MHF
|
|
|
|
|
Hi,
By using regular expression you can able to do it.
Just go through the below coading:
<asp:regularexpressionvalidator id="regexpName" runat="server"
="" errormessage="This expression does not validate." controltovalidate="txtName" validationexpression="^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$">
For more details just visit this site:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/PAGHT000001.asp
Regards
Exelio
|
|
|
|
|
the best way to do email validation is by using java script.
Just cut and paste the following java script. it will work fine.
<html>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function emailCheck (emailStr) {
var checkTLD=1;
var
knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|in
fo|pro|museum)$/;
var emailPat=/^(.+)@(.+)$/;
var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
var validChars="\[^\\s" + specialChars + "\]";
var quotedUser="(\"[^\"]*\")";
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
var atom=validChars + '+';
var word="(" + atom + "|" + quotedUser + ")";
var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
var matchArray=emailStr.match(emailPat);
if (matchArray==null) {
alert("Email address seems incorrect (check @ and .'s)");
return false;
}
var user=matchArray[1];
var domain=matchArray[2];
for (i=0; i<user.length; i++) {
if (user.charCodeAt(i)>127) {
alert("Ths username contains invalid characters.");
return false;
}
}
for (i=0; i<domain.length; i++) {
if (domain.charCodeAt(i)>127) {
alert("Ths domain name contains invalid characters.");
return false;
}
}
if (user.match(userPat)==null) {
alert("The username doesn't seem to be valid.");
return false;
}
var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {
for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Destination IP address is invalid!");
return false;
}
}
return true;
}
var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;
for (i=0;i<len;i++) {
if (domArr[i].search(atomPat)==-1) {
alert("The domain name does not seem to be valid.");
return false;
}
}
if (checkTLD && domArr[domArr.length-1].length!=2 &&
domArr[domArr.length-1].search(knownDomsPat)==-1) {
alert("The address must end in a well-known domain or two letter " +
"country.");
return false;
}
if (len<2) {
alert("This address is missing a hostname!");
return false;
}
return true;
}
</script>
</HEAD>
<BODY>
<form name=emailform onSubmit="return emailCheck(this.email.value)">
Your Email Address: <input type=text name="email"><br>
<input type=submit value="Submit">
</form>
</body>
</html>
Vipin
|
|
|
|