|
in asp.net.. in Gridview i created "Download" and "View" Button field.. how can i view the pdf file when i click ti view button as well as how can i download when i klick this download button..
|
|
|
|
|
hammathMuneerul huda wrote: how can i view the pdf file when i click
hammathMuneerul huda wrote: how can i download when i klick this download button
No need to provide two separate links. Single link 'View', on click of which you need to launch the file with Process.Start , it will automatically prompt a dialog asking to Open or Save it. User can do whatever they want.
Process.Start("filePath with name");
P.S.: Next time avoid making the whole question bold.
|
|
|
|
|
i am developing a project in which admin uploads the testimonials in database.
for this i have created a table in database and testimonials are stored in column "descr" of table "test".
now i want to fetch all the testimonials one by one on the home page in a marquee.
i am able to retrieve only first id value means only one testimonial in a marquee, but i want to upload all the testimonials one after another in a marquee.
can anybody please help
Jasbeer Singh
.Net Developer
|
|
|
|
|
|
thankx, but i want coding for that, i have tried this. but can u please provide coding for this
|
|
|
|
|
Jasbeer Singh wrote: but i want coding for that, i have tried this. but can u please provide coding for this
No. No one will provide full code to you.
You need to try by yourself. Try out and post specific issues if you face any.
|
|
|
|
|
thanks i am almost done.. but am not getting more than one testimonial in a marquee, i am getting only one and rest are not displayed in marquee.
|
|
|
|
|
Am trying to make a map with markers , the lat and lng are stored in mdb file , but I want also to display the markers with the name of the location in a GridView1, but whatever am doing is not working , this is what I have tired till now... so can anyone help plz ?
function initialize() {
if (GBrowserIsCompatible()) {
var gmarkers = [];
var gicons = [];
var baseIcon = new GIcon(G_DEFAULT_ICON);
baseIcon.iconAnchor = new GPoint(9, 34);
baseIcon.iconSize = new GSize(20, 34);
baseIcon.infoWindowAnchor = new GPoint(9, 2);
function createMarker(point, name, html, category) {
var marker = new GMarker(point, gicons[category]);
marker.mycategory = category;
marker.myname = name;
GEvent.addListener(marker, "click", function () {marker.openInfoWindowHtml(html);});
gmarkers.push(marker);
return marker;
}
function show(category) {
for (var i = 0; i < gmarkers.length; i++) {
if (gmarkers[i].mycategory == category) {
gmarkers[i].show();
}
}
document.getElementById(category + "box").checked = true;
}
function hide(category) {
for (var i = 0; i < gmarkers.length; i++) {
if (gmarkers[i].mycategory == category) {
gmarkers[i].hide();
}
}
document.getElementById(category + "box").checked = false;
map.closeInfoWindow();
}
function boxclick(box, category) {
if (box.checked) {
show(category);
} else {
hide(category);
}
makeSidebar();
}
function myclick(i) {
GEvent.trigger(gmarkers[i], "click");
}
function makeSidebar() {
var html = "";
for (var i = 0; i < gmarkers.length; i++) {
if (!gmarkers[i].isHidden()) {
html += '<a href="javascript:myclick(' + i + ')">' + gmarkers[i].myname + '<\/a><br>';
}
}
document.getElementById("side_bar").innerHTML = html;
}
var map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(53.8363, -3.0377), 11);
var markers = document.getElementById('<%= GridView1.ClientID %>');
for (var row = 1; row < markers.rows.length; row++) {
for (var col = 0; col < markers.rows[row].cells.length; col++) {
if (col == 0) {
if (document.all)
var heading = new markers.rows[row].cells[col].innerText;
else
var heading = new markers.rows[row].cells[col].textContent;
}
if (col == 1) {
if (document.all)
var terrnaam = new markers.rows[row].cells[col].innerText;
else
var terrnaam = new markers.rows[row].cells[col].textContent;
}
if (col == 2) {
if (document.all)
var lat = new markers.rows[row].cells[col].innerText;
else
var lat = new parseFloat(markers.rows[row].cells[col].textContent);
}
if (col == 3) {
if (document.all)
var lng = new parseFloat(markers.rows[row].cells[col].innerText);
else
var lng = new parseFloat(markers.rows[row].cells[col].textContent);
}
if (col == 4) {
if (document.all)
var address = new markers.rows[row].cells[col].innerText;
else
var address = new markers.rows[row].cells[col].textContent;
}
if (col == 5) {
if (document.all)
var category = new markers.rows[row].cells[col].innerText;
else
var category = new markers.rows[row].cells[col].textContent;
}
else
if (document.all){
var str = new markers.rows[row].cells[col].innerText;
var point = new GLatLng(lat, lng);
html = terrnaam + ' ' + address;
var marker = new createMarker(point, name, html, category);
map.addOverlay(marker);
}
}
show("terreinen");
show("gebouwen");
makeSidebar();
}
}
else {
alert("Sorry, the Google Maps API is not compatible with this browser");
} }
</script>
terreinen:
gebouwen:
|
|
|
|
|
Hi
i have a fileupload control in form, and now i want to check the size of file before upload it. i wrote this code but the value of fileSize = 0 all the time. what should i do. can anybody help me?
int fileSize = fuSignature.PostedFile.ContentLength
|
|
|
|
|
Please do not cross-post. You've already posted this in the C# forum.
|
|
|
|
|
I would like to share sample program regarding files clean up on Browser close button.
1.Include below script
<script type="text/javascript">
$(document).ready(function () {
$(window).unload(function () {
if (event.clientY < 0) {
$.ajax({
type: "POST",
url: "Default.aspx/Cleandir",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: true
});
}
});
});
</script>
2. In code behind, create method using [WebMethod]attribute.
[WebMethod]
public static void Cleandir()
{
try
{
DirectoryInfo dirinfor = new DirectoryInfo(@"C:\Users\Desktop\image");
if (dirinfor.Exists)
{
FileInfo[] filename = dirinfor.GetFiles();
if(filename!= null)
{
if (!(filename.Length.Equals(0)))
{
foreach(FileInfo f in filename )
{
File.Delete(f.FullName);
}
}
}
}
}
catch (Exception ex)
{ }
}
}
Basically web method is being called using Ajax in jquery when user clicks on Browser close button.
Thanks,
Ashwani Kumar Vishwakarma
From Jabalpur
|
|
|
|
|
Why post this here? You do know that it will disappear off this page pretty quickly don't you? Why not post it as a Tip/Trick instead?
|
|
|
|
|
I'm looking for some kind of best practice fot imersonate users to one ASP.NET site that I build.
The user handling of the site is entirely own built with a "User" table in the database and so on. The "Password"-column is crypted.
Now I want to build a simple and SAFE solution for our support personal so they from our Support site can click on a button and a session is started in the customer portal. That so he support person more easily can log in as he was the customer user and se the same thing as the customer do.
Any tip on how to solve this is welcomed. Now I think about creating a GUID and send that in querystring that is pased to the customer portal. The GUID can be used for a short period.
_____________________________
...and justice for all
|
|
|
|
|
how to update data in grid view???
|
|
|
|
|
|
Hello all,
On the left side of my page we have created toolstrip, with that we have panel & property grid. we have images in toolstrip when i click on the image. image goes to panel where we can large the image and assigning the values of image to property grid with these line of code.
propertyGrid1.SelectedObject = (sender as System.Windows.Forms.PictureBox);
Now my problem is when click on the image it move slightly. we want to stop that click of image. Please help me.
Thanks in advance.
Sanjeev
|
|
|
|
|
Wrong forum! You should have posted in C# forum[^]
For now, to stop click of image, you can make it readonly/disabled?
|
|
|
|
|
Hi
In my page i have 4 text boxes which are associated with ajax calender.user can enter the date or can select from the calender.Currently I have put 4 custom validator to validate the user input and I have associated a jave script function onclientfunction of the validators to check the date format. My idea is that if i put only one custom validator and can check for all the different inputs to validate the date. is it possible?
my java sript function takes two parameters (source, args).If it is possible please send me the sample code.
In custom validator there is one attribute which says the control to validate?Now for each control i have to put a validator. I want one validator to check for all the text input.Is it possible. I am new to ASP programing.So please give the sample code. I want like if i exit the text box or click on the save button this should work.And this should be done in client side not in the server.
Thanks
Prashant
|
|
|
|
|
i want to set a value of label using javascript and that value will from asp.net codebehind...
codebehind code:
vimage.Attributes.Add("OnMouseOver", "divimgcomments('" + divcmdstext + "');");
javascript code:
function divimgcomments(imgcmds) {
//alert(imgcmds);
var _vlblmoimgcmnds = window.document.getElementById("<%=lblmoimgcmnds.ClientID%>");
_vlblmoimgcmnds.value = imgcmds;
divimgcomments1();
}
|
|
|
|
|
Not too clear on what is the issue and what you seek!
Try:
vimage.Attributes.Add("OnMouseOver", "divimgcomments('" + divcmdstext + "');");
function divimgcomments(imgcmds) {
var _vlblmoimgcmnds = window.document.getElementById("<%=lblmoimgcmnds.ClientID%>");
_vlblmoimgcmnds.InnerHTML = imgcmds;
}
|
|
|
|
|
Bind Two charts from two dataset shoing charts grouped in RDLC asp.net
|
|
|
|
|
|
I was looking for how to use the dataadapter to make updatings on multiple tables with a single transaction.
I´ve found a couple examples, but they just add, more questions. As I understood in order to dataadapter could trace the table´s changes we have to fill the dataset with each table data store in the database by doing select * from table and then using dataadapter.fill method. But in the most of cases the tables are so big enought and because of web environment many user can using the application at same time, the server could easily crash.
When I use classical asp 3.0, I created *.cls classes and compile them to get an .dll file.
One of the more important class was one it wrapps the database operations. basically its structure was: two properties,bSuccessful,sSql. Its methods ExecQuery
wich basically was
bSuccessful = 1
sSql = "update,insert,delete ...."
oConn.execute
on error:
bSuccessful = 0
exit sub
For example, clsEvaluation has a RegisterEvaluation method,
it uses the clsDBoperation in order to control the operations.
RegisterEvaluation
set oConn = new clsEvaluation
oConn.Connect
oConn.startTransaction
oConn.setsSql = " insert, edit , delete .... "
If oConn.getbSuccessful = 1 then
.....
else
oConn.stopTransaction
endif
I did did the same, building a class with .NET 3.5, but now i´m wondering can it be achive using a dataadapter?
P.D: I´m sorry if the question is long but I considered to be as clearer as possible
|
|
|
|
|
Is there any Need to Install Crystal Reports on Web server if we Use them in our Web Application
|
|
|
|
|
You have already asked this in QA.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|