|
Hi in datagrid template column u have the hyper link or outside the grid u have?,
If inside the grid u have the hyperlink,then u can access the link using this code:
For Each MainGRD As DataGridItem In Me.dgrdmain.Items
dim Candid as HyperLink=ctype(maingrd.FindControl("Idofhyperlink"),HyperLink)
Next
Here candid is the hyperlink now...,
U can use ur if condition based on that candid...,
Did u got it?,
Regards,
Magi
|
|
|
|
|
hi magi
I already wrote the code its working fine my problem is i want to write a condition (if else)so that i can execute my code, Pl see the code in post.
So just tell me the if condition. Like suppose i click on the 1 column of the grid some thing like this( datagrid1.item.....)
Regards
Prakash Mishra(Banglore,India)
|
|
|
|
|
Hi i think this is ur probs...,
In datagrid ur displaying the candidate id and his photo...,
Based on the candi id selection it want to open another child window and show his details ?,
If its yes...,
Use this way,.
In ur datagrid property bulder select the hyperlink column and there u can see "Url format string", There give some other aspx page form and ur passing parameter...,
Means it should eb like this:
frmCashflowStatementLink.aspx?candid={0}
Then there itself see the "target" dropdown box there u select "-new"
Then Go to that child page(for me i have taken this one frmCashflowStatementLink.aspx)
In ur pageload not postback method give this code:
txtLinkID.Text = Request.QueryString("candid")
Then in ur sqladapater query u check with that txtlinkid value...,
If its correct display those values like...,
This only u asked na?,
Regards,
Magi
|
|
|
|
|
Hi magi i just asked the IF condition in vb for the data grid
eg
if( first column is selected)
do some thing
else
do some thing
I want to know in the bracket what i have to write, any r u form bangalore?
Regards
Prakash Mishra(Banglore,India)
|
|
|
|
|
.
why didnt u can use query string for passing candid?
In datagrid , create a template column with hyper link
like
<<code> <asp:TemplateColumn HeaderText="News Heading">
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle Width="35%"></ItemStyle>
<ItemTemplate>
<asp:HyperLink Runat =server CssClass=Newslink NavigateUrl ='<%#GetURL(DataBinder.Eval(Container.DataItem, "NewsId").ToString())%>' ID="Hyperlink1">
<%#DataBinder.Eval(Container.DataItem, "NewsHeading")%>
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
</code> >
in c#
<br />
protected string GetURL (string fldval ) <br />
<br />
{ <br />
<br />
string SzOpenwindow="";<br />
<br />
<br />
SzOpenwindow="javascript:openMywindow('yourpage1.aspx?&id="+ fldval +"','View',500,320)";<br />
<br />
return SzOpenwindow; <br />
<br />
}<br />
writa js
function openMywindow(url,name,iWidth,iHeight)
{
var iLeft = (screen.availWidth-500 - iWidth/ 2);
var iTop = (screen.availHeight-420 - iHeight / 2);
var features;
var objwindow;
features = "width="+iWidth+",height="+iHeight+",left="+iLeft+",top="+iTop;
features += ",screenX="+iLeft+",screenY="+iTop;
features += ",scrollbars=1,resizable=0,location=0";
features += ",menubar=0,toolbar=0,status=0";
objwindow = window.open(url,name, features);
}
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
Give command name property to both link.
Like as for link1 CommandName="Link1"
and link2 CommandnName="Link2"
Now U can use If condition on GridView rowcommand event
If(commandName=="Link1")
{
//code is here for link1
}
else if(commandName=="Link2")
{
//code is here for link2
}
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
Hi,
FileUpload control is not working in Mac PC. It is working fine in Windows PC.
Please let me know how to resolve it in Mac.
Thanks!!
Jagadeesh
-- modified at 1:48 Saturday 28th July, 2007
|
|
|
|
|
Define 'not working' ? Have you looked to see what HTML is being generated for the Mac browser ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi Christian,
The HTML is same on Mac and Windows.
But it is not working on Mac.
Plz Help.
Regards,
~Jagadeesh
|
|
|
|
|
Then the problem is the Mac browser sucks. Not much you can do about that.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Standard question #1:
What do you mean by "not working"?
Unless you explain what's happening, there is no information that points to any possible reasons for the problem.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi.
In ASP3.0 (Not ASP.Net), I can't run a page that has DB connection!
It must be uploaded on server and then I can test that page?
Locally on my computer I can't test these pages that work with DB?
I use Windows vista.
Best wishes
|
|
|
|
|
Huh?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I guess the two questions are ,why are you using ASP, and why are you asking in the ASP.NET forum ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
1. It's a practice in a class
2. there is no forum for ASP3 here
3. If you can't help, don't post anything, please!
Best wishes
|
|
|
|
|
1 - any class that wanted to teach me asp in 2007, I would drop immediately, and let the teacher know they are stupid. No-one uses that rubbish anymore, unless it's legacy apps.
2 - There is a web development forum for outdated technologies such as ASP and PHP
3 - actually, you're far more likely to get help if you post in the right place, so I *am* helping.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi all
I want to create a web form.In this form I have a data Grid(GridView1). This grid view contains some rows that fetch from a table of a database.I want to insert a button at the last column of each row, This button must update a row which selected which but I don't know how to insert this button and how to write click event for each button
|
|
|
|
|
Hi,
I'm wondering,did u mean that u want a button each row in last column, and u want that event button able to update value on row selected?
maybe u can checked the enable edit checkBox on u're gridview and set the properties to a button..so when the edit button pressed it allow user to change/update value on the selected row
Hope that answer u're question
Regards,
Tomi
|
|
|
|
|
Yeah I mean a button each row in last column, and I want when user click each button update value on selected row, but I don't know how to reach this goal.I use auto format of data grid(VS 2005)but I don't know how to set.
|
|
|
|
|
1.First expand properties of data grid (little arrow on top right corner) it will show some properties like : auto format, etc..
2. find the checked box at that properties (enable editing, enable deleting, enable select, and etc..)
3. checked the checkbox which enable editing..and maybe if u want to enable the other just click the checkbox
4. after u checked the properties, find a link name Edit if u checked the checkbox for enabled the editing, and link Delete if u enable deleting in your data grid..
5. on the runtime that link will allow user to update the data of the selected column
6. if u want to make this link to be a button or naming the link,just change the properties and change it like u want to be
Hope this can help u
Regards,
Tomi
|
|
|
|
|
Hello
this my code:
<asp:repeater id="myRepeater" runat="server">
<headertemplate>
<itemtemplate>
What i try to do is to write in the Label where i put the text: "dddddddddd" to have a real data from a Session or maybe from the same Querry the repeater is fill
Tanks in advance
Assaf <asp:label runat="server" id="LblName" text="dddddddddd"> | Grade Name | Institution Name | <%#DataBinder.Eval(Container.DataItem, "GradeName")%> | <%#DataBinder.Eval(Container.DataItem, "InstitutionName")%> |
|
|
|
|
|
You seem to have not checked 'Ignore HTML tags in this message (good for code snippets) and htmlised half your code.
One way to do this is to set the Text to get it's value from calling a method, or you could just use the code inline, in a server code block. This works the same way as the DataBinder.Eval, just replace it with Session["mykey"].ToString() or something ( a method which checks if the value is null is obviously better )
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi, in the code below the IF statement is used for multiple selection of list items in a list box. The select statement is supposed to select the CarID and the Model fields From the table CarTB, where the value of the field Make equals the text value of the list item in my list box that has been selected.
Dim DS As New DataSet
For i = 0 To CarNamesDL.Items.Count - 1
If CarNamesDL.Items(i).Selected Then
BConn = New OdbcConnection("Driver={MySQL ODBC .51Driver};Server=myServer;Database=CarCompaniesDB;User=myUserassword=myPass;Option=3;")
DBCommand = New OdbcCommand("SELECT CarID, Model From CarTB where Make = '" & CarNamesDL.Items(i).Text & "'", DBConn)
End if
Next
I get the error "Character constant must contain exactly one character" and visual studio is saying that the select statement is the cause. Please take a look and explain to me what I did wrong in the select statement. Thank you in advance for your help.
|
|
|
|
|
Apart from not protecting yourself from SQL Injection ?
ASPnoob wrote: User=myUserassword=myPass;
I assume this should be User=myUser;Password=myPass; ??
Does MySQL use single quotes for strings ? Perhaps it's assuming that ' is for a char, and so it's complaining that there's more than one character in there ? MySQL sucks.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi ,
I'm using a web service to copy file to a network folder restricted to a specififc username & pwd.
I tried
<identity impersonate="treu" username="domain\user" password="pwd">
It did not work.
Thanks in advance
Priya
|
|
|
|