|
Hi,
The following code is what iam writing to have a hyperlink on the gridview.Now when i click the link, a popup window opens.The link carries the information of the product_id to the popup window with the help of which i access some other details of that particular product.
<asp:TemplateField HeaderText="PRODUCT" >
<ItemTemplate>
<a class="tableLink" id="aLeadInfoDetails" href="#" value='<%# Eval("product_id")%>' onclick="PopUp(this)" runat="server"><%# Eval("product_name")%></a>
</ItemTemplate>
</asp:TemplateField>
The script part is the following:
function PopUp(obj)
{
window.open('WebForm2.aspx?productId='+ obj.value ,'popupwindow','status=yes,toolbar=no,resizable=no,scrollbars=yes,top=100,left=200,width=650,height=500');
}
Now this works absolutely fine on the IE but not on the FireFox browser Can anybody help me do the same on firefox as well...?
Tk..
|
|
|
|
|
You can put the value in a property that exists, intead of inventing a new one:
<a class="tableLink" id="aLeadInfoDetails" href='<%# Eval("product_id")%>' onclick="PopUp(this);return false;" runat="server"><%# Eval("product_name")%></a>
Now you can use obj.href in the function to get the value.
Alternatively, you can put the value directly in the call to the method.
Notice that I added return false; in the onclick event. That prevents the link from being activated.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hey thanks for the help...the change u told didnt work...but i got the window with the value in FireFox as well....
Kt..
|
|
|
|
|
this is my sql query
rg=request.Form("dname")
SQL2 = "SELECT Firstname,Surname FROM tblMembers where ID='"&rg&"'"
set RS = objConn.Execute (SQL2)
but am getting the following error message:Data type mismatch in criteria expression.please help,time is running
|
|
|
|
|
If your ID is numeric then you shouldn't enclose it in apostrophes. This would make your query:
SQL2 = "SELECT FirstName, Surnam FROM tblMembers WHERE ID=" & rg
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
there is a PHP file with which I try to communicate.
there is a simple HTML like that:
"<form action='feedback.php' method='POST'>blablabl</form>"
now I try to write some C# code to invoke the PHP from a desktop app, which look like that:
====================
static HttpWebRequest CreateRequest(string url, string method, IDictionary<string, string> parameters, Stream data)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = method;
foreach (string key in parameters.Keys)
request.Headers.Add(key, parameters[key]);
using (Stream reqStream = request.GetRequestStream())
{
//request.Headers.Add("Content-Length:", reqStream.Length.ToString());
CopyStream(data, reqStream);
}
return request;
}
====================
where URL is the URL of the PHP page.
unfortunately nothin is picked up by the PHP script.
did I miss something?
how do I submit multiple file btw?
|
|
|
|
|
You do need to set the content length. I see that you have commented out that line. You wouldn't be able to set the content length there anyway since you don't know the length of the reqStream Stream until after you have copied the incoming stream into it.
If you set the length and still have problems I think you would want to make sure your data stream coming in has data in it.
You also may need to set the content type. In my example below I am sending an xml file to a web page.
I would pass in a string instead and do something like this:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(p_returnUrl);
request.Method = "POST";
request.Accept = "text/xml";
ASCIIEncoding encoding = new ASCIIEncoding();
byte[] byte1 = encoding.GetBytes(data);
request.ContentType = "text/xml";
request.ContentLength = byte1.Length;
Stream newStream = request.GetRequestStream();
newStream.Write(byte1, 0, byte1.Length);
newStream.Close();
That code seems to work just fine for me.
Hope that helps.
Ben
|
|
|
|
|
Here is description of the problem.I have install orcas in not default folder. My folder is: D:\Program Files\Microsoft Visual Studio 9.0 ...
after that I've install ajax, and when I try to make simple ajax-project, I can't find template ASP.NET AJAX-Enabled Web Site. What castomization I must do else?
|
|
|
|
|
Hi
my .html page has a form where the user can enter his/her details , What I want to do is once the user has enetered all the details and clicked on submit, is to send that information to my e-mail address, is there a way I can go about doing this ?
Le Roux Viljoen
Web Developer
PCW New Media
South African Branch
www.pcwnewmedia.com
|
|
|
|
|
You need to have some kind of server-side script to handle the form information and send the email. What you can get will obviously depend on your hosting setup but my guess would be PHP is supported and there are literally hundreds of free PHP email scripts out there, just do a google search.
|
|
|
|
|
Hi Guys,
I have this weird results from my parameters.
I am trying to update one of the table and the thing that i noticed was, one of the parameter doesn't give the exact value, I think. Because it doesn't update the data that I selected thru dropdownlist.
Below is my SQL Statement on how to update the table:
UPDATE tblTitle_Category SET Cat_ID = @Cat_ID WHERE (PlayID = @PlayID) AND (Cat_ID = @Cat_ID2)
Parameters:
All the parameter values came from different textboxes, and the textboxes as I displayed it on my page, all of them has a value @PlayID = 5, @Cat_ID = 34, @Cat_ID2 = 35.
Problem:
It doesn't update at all. The value of @Cat_ID which is 34 does not saved.
But when I tried typing the number "34" (hard coded), then it will update.
What do you think is the problem and how can I correct it. My code is perfectly coded. Is this a bug?
Thanks in advance Guys
hifiger2004
|
|
|
|
|
hifiger2004 wrote: My code is perfectly coded
I bet it isn't
Can you post the DB Access code - looks like it's there that yer problem lies...
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi Richard,
Sounds like you're already know if what the problem is
Ok it's goes like this...
-------------------------------------------------------
First I have a table named tblTitle_Category and has only two fields - "PlayID" and "CatID".
And then I have also another table named tblCategories which contains only two fields - "CatID" and "Description".
tblTitle_Category:
PlayID CatID
1 1
1 2
2 3
2 4
3 5
3 6
tblCategories:
CatID Description
1 Liquid
2 Solid
3 Stone
4 Wood
5 Steel
6 Place
So, we have now a tblTitle_Category table and tblCategories table. And inorder to link them both, of course we need to join them using the Left Outer Join SQL Statement.
ASP.Net 2.0 Web Controls used:
1 - GridView, used for non editable records, only viewing purposes.
2 - DetailsView, used for inserting, editing and deleting of records.
GridView's SQLDatasource Statement:
Select tc.PlayID, tc.CatID, c.Description * From tblTitle_Category tc
Left Outer Join tblCategories c on tc.CatID = c.CatID
DetailsView's SQLDatasource Statement:
Select:
Select tc.PlayID, c.Description * From tblTitle_Category tc
Left Outer Join tblCategories c on tc.CatID = c.CatID
Insert:
Insert Into dbo.tblTitle_Category
(PlayID, CatID)
Values
(@PlayID, @CatID)
Edit:
Update dbo.tblTitle_Category
Set CatID = @CatID
Where PlayID = @PlayID and CatID = @CatID2
In my DetailsView I have a template for DropDownList for tblCategory.Description.
I have 3 parameters for editing existing record by just changing the tblCategory.Description thru the DropDownList.
Parameters:
@PlayID = From Other GridView source (I checked the value thru msgbox and the value is correct)
@CatID = TextBox1.Text (The value of TextBox1.Text is the CatID based on the DropdownList
selection that I passed).
Code below:
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As
System.EventArgs)
TextBox1.Text = CType(sender, DropDownList).SelectedValue
End Sub
@CatID2 = TextBox2.Text (The value of TextBox2.Text is CatID based from the GridView's CatID)
And, that's all. It's very simple, isn't it?
But I really don't know if why the category can't be saved when I select another category from the DropDownList.
I am hoping that you can simulate this one, and I think you will get the same problem
By the way I am using MSSQL2005. Anyway, Access DB will do.
Thanks in advance.
-- modified at 12:59 Monday 23rd April, 2007
hifiger2004
|
|
|
|
|
What are the data types(and lengths) of the fileds in those tables?
|
|
|
|
|
All ID fields are integer "int". PlayID and CatID fields were declared as int.
hifiger2004
|
|
|
|
|
Just to be sure, why don't you parse the ID's to the update as int's first before doing the update?
I'm not sure if this is your problem, but it wouldn't hurt to do it 
|
|
|
|
|
I parse all ID's, and I even tried converting the parameter value passed into integer just to be sure, but still the problem is there
hifiger2004
|
|
|
|
|
Im starting a new site using FrontPage and Im still clueless when coming to a few things like, getting expandable menus on buttons, and marqueing text(moving text).
Please help, where you can
kagiso
|
|
|
|
|
My best answer, but it won't help you much, is to stay away from Frontpage, as it is limited and will make you frustrated.
The moving text, is called a marquee, and holds the <marquee> tags. Maybe worst case scenario, you can have the part that you want to be moving, and put it in marquee tags.
Expandable menu's on buttons.. can be done with CSS. Do you want something like a folded out menu?
www.code.ae
|
|
|
|
|
matjame wrote: Im starting a new site using FrontPage
As Michael Hendrickx said FrontPage is not a good editor. It will put things in the code to ensure that the page will not render on anything but IE. GoLive is not much better as you will also have cross browser compatibility problems, just not the same problems as FrontPage.
Getting HTML to render properly on a wide variety of browsers is like trying to herd cats. They all have their own agenda and it is not the same as any other.
I would recommend using an HTML editor, like HTML-Kit and learning how to hand code HTML. It really isn't that difficult once you get past the basics and HTML-Kit has templates to get you started with the basic framework. HTML-Kit is a free download.
Separate the layout from the presentation using CSS and you will be able to make site wide changes in one place as opposed to going through every page looking for formatting parameters.
Go to W3C HTML Tutorial[^] if you would like to get started learning HTML.
HTML looks daunting at first but it is easy once you get used to it. Then you can move on to javascript and a server side scripting language to make dynamic pages. There are a lot of examples on the web so it is easy to get examples of working code.
|
|
|
|
|
please ,anyone who can help me as soon as possible,i need the code,asp code,to take input from user and display this specific user information from my database, 
|
|
|
|
|
I require a software component to be added to an existing .net application(web based). The coponent or the software should posses the following features:
1. It should provide PC to Phone integration either on VOIP technology or TAPI or both.
2. It should provide automated phone dialing from phone number lists.
3. Transfer calls to other users internally.
4. Record conversations and provide automated call reports and statistics.
5. Every phone number in the system should be automatically clickable and the call details must be logged to that user.
6. The phone call must be recorded and stored as a sound file.
Can anyone help me to find any freewares or commercial products available in the market which can provide me the above features.
Thanks in Advance
----------------------------------
where there is a will there is a way
|
|
|
|
|
how can i make an input mask on textbox for a date mm/dd/yyyy. example input 16/07/1975. initially it should be displayed like __/__/____ and if i enter a digit then underscore should be replaced by that digit rest should remain same.
any help would appreciate..
thanks..
Dinesh Sharma
|
|
|
|
|
I dont know much about javascript, but you can use the MaskedEdit extender from AJAX toolkit. Its much easier. I know you will have to use the OnKeyPress type of event to do this. Also the OnBlur event. But I am not sure how to do this in javascript. If possible try using the AJAX control I suggested. Hope I helped you in some manner ?
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Is there a way to change change the button that is checked in a radio button group programmatically?
I have a group of buttons that control the presentation of a web page. That is if a button is clicked a form expands to offer more options. Originally that part of the form is hidden and it is only visible if the yes button in a yes/no group is clicked. Originally the no button is checked by default.
I set a state variable for future reference and hide the buttons from view. Everything works fine transitioning from view to view unless the refersh browser control is pressed for a reset of the form.
On Opera original state of the form is visible, as it should be, and the no button is checked, as it should be. This is consistant with the original form the first time it is loaded.
On FF the yes radio button is clicked but the form is not expanded which is inconsistant. To make matters worse I need to first click the no button to get the yes button to respond again. Even though it is checked it is not active until the other button is clicked.
On IE both buttons are unchecked and the form is in original state. Not quite consistant with the original state of the page but at least a click on the yes button expands the form.
If I can re-check the no button before I hide the buttons things would work consistantly on FF and Opera.
If I could uncheck both buttons I could use that on the original page and at least things would be consistant on all three browsers.
My question is how do I click a radio button programatically in javascript? Or failing that how do I uncheck a checked button (the yes button) programmatically in javascript?
|
|
|
|