|
I want to add the multiple dropdownlist to my tool box...can u help me??????
Ashshu
|
|
|
|
|
What is the problem you are having?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
|
<pre lang="text">
<asp:DropDownList ID="drd1" runat="server" >
<asp:ListItem>select the value</asp:ListItem>
<asp:ListItem>sample</asp:ListItem>
<asp:ListItem>Anothersample</asp:ListItem>
<asp:ListItem>one more sample</asp:ListItem>
<asp:ListItem>none</asp:ListItem>
</asp:DropDownList
>
Ashshu
|
|
|
|
|
What is your question?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
At first your question was not clear. But after adding few characters I got it. Always post your question clearly.
You should customize the control. Check this article(and you could fine bunch more in Codeproject)
DropDown and MultiselectDropDown Controls for ASP.NET[^]
Or alternatively you could use ListBox[^]
|
|
|
|
|
How can i see if Ok or cancel is pressed?
Code:
Private Sub GridView1_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GridView1.RowCommand
If (e.CommandName = "DelUser") Then
Dim index As Integer = Convert.ToInt32(e.CommandArgument)
Dim row As GridViewRow = GridView1.Rows(index)
Dim cmd As SqlCommand = New SqlCommand("DELETE [dbo].[MOVIuser] " & _
"WHERE ID = @U_ID ", conn)
cmd.Parameters.Add("@U_ID", SqlDbType.Int)
Dim message As String = "Möchten Sie den Benutzer " & _
CStr(row.Cells(3).Text) & ", " & CStr(row.Cells(4).Text) & " wirklich löschen?"
Dim sb As New System.Text.StringBuilder()
sb.Append("<script type = 'text/javascript'>")
sb.Append("window.onload=function(){")
sb.Append("return confirm('")
sb.Append(message)
sb.Append("')};")
sb.Append("</script>")
ClientScript.RegisterClientScriptBlock(Me.GetType(), "alert", sb.ToString())
/* Which Button is pressed? */
Try
conn.Open()
cmd.Parameters("@U_ID").Value = CInt(row.Cells(1).Text)
Catch ex As Exception
Finally
conn.Close()
End Try
End If
End Sub
|
|
|
|
|
Did you look at the sender object that calls the sub?
Oh, your talking about the Javascript.
You can't do it that way.
More like
Button calls JavaScript first by using a click event assigned to the button. if true is returned then the called function runs and deletes the user.
ASP.Net Button Code
OnClientClick="return deleteUser();"
Javascript Code
function deleteUser() {
if Confirm("Delete User") {
return true;
}
}
|
|
|
|
|
+5
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Aslam O Alaikum Every Body
I have Confusion How I Deploye an Desktop Application Exe File On Local Server
|
|
|
|
|
Alaikum Salam Bhai,
You just compile the program in "Release" mode, then copy the entire content of "Release" folder, put it on the deploy machine.
Hope this helps!
Thanks!
- Francis S
|
|
|
|
|
desktop application(.exe) is installed and not deployed.
|
|
|
|
|
If you want to go with installer, Please try the below link:
CodeProject URL
Hope this helps!
|
|
|
|
|
As a part of my project I have used chart control in which I a drawing a regression curve for the series of points. But the curve is not showing fully. Could anyone please help me to resolve this issue.
The code is below:
chrt_ScatterPlot.DataManipulator.FinancialFormula(System.Web.UI.DataVisualization.Charting.FinancialFormula.Forecasting, "Linear,1,false,false", dd_Location.SelectedItem.Text, chrt_ScatterPlot.Series["TrendLine"].Name.ToString());
|
|
|
|
|
I have a modalpopupextender and i have a panel inside that..in the panel i have a gridview.As the size of gridview increases it goes out of the modalpopup.How to keep the size of modalpopup increase according to that of the grid..
|
|
|
|
|
if you are looking to add scroll bar to your popup than set the css overflow property to auto...
<asp:panel style="overflow: auto;height:100%; width: 100%;" >
|
|
|
|
|
I was thinking for some time to try and do some home automation by building a system to manage my library of physical books.
Basically I'm thinking on building a system that automatically retreives and stores books from a shelf based on user input. Add to that, I'm also thinking on building a system that could browse through Amazon and order books for me.
I can handle the first part but I have absolutely no idea how to approach the automatic book ordering system. Now, I can imagine a dozen reasons why Amazon wouldn't want people abusing their website but I would really like to come up with something that could just grab whatever book title I tell it to look for and just do the order for me.
Is this even possible? To be fair I don't have much experience in web programming, I'm more familiar with embedded systems, desktop apps and games so I'm not sure if its feasable to write something in C# to do this or if there's some kind of API provided by Amazon that would allow me to automate the ordering process.
I know I can use POST to tell the server to accept data but I don't know if something as simple as this would work in my case.
Heck, if its not possible for Amazon, any other decent place where I can order books from would be nice.
|
|
|
|
|
Why not just buy a kindle?
|
|
|
|
|
|
I Have created Pdf file using ITextsharp.dll which is works. but it does not work with css. How I generat pdf with well formating??
|
|
|
|
|
|
Google is a website. If you want to know what services (paid or free) they offer then try their help or contact them directly.
|
|
|
|
|
|
Hi Gurus,
We have an online ballot app that has a bunch of radioButtonList with values dynamically populated from the database.
Please see screenshots below to see example ballot
Sample ballot
All values ( Candidate A, Candidate B, Write In Candidate) are all stored on the database dynamically populate the radioButtonList.
Example 1 shows the current setup.
How do I modify my script to have setup similar to example2?
Here is the code I am working with so far:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Online Ballot</title>
<meta http-equiv="X-UA-Compatible" content="IE=7, IE=8, IE=9, IE=10, IE=11" />
<meta name="DownloadOptions" content="noopen" />
<link rel="Stylesheet" href=
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type = "text/javascript">
function validateCheckBoxList(source, args) {
var chkListModules = $(source).parent().find("table[id$='_CheckBoxList1']");
if (chkListModules.length == 0 || chkListModules.find(
args.IsValid = true;
else
args.IsValid = false;
}
</script>
<script type="text/javascript">
function show(ctr) {
var tb = document.getElementById("TextBox1");
if (ctr == "RadioButtonList1") {
tb.style.display = "block";
}
else
tb.style.display = "none";
}
</script>
<style type="text/css">
fieldset { border:1px solid red }
legend {
padding: 0.2em 0.5em;
border:1px solid red;
color:green;
}
</style>
</head>
<body background="images/bg.gif">
<form id="form1" runat="server">
<table bgcolor="#003366" width="100%">
<tr><td><img src="images/ballotslogo.png" alt="" /></td></tr></table>
<div id=
<div class=
</div></div>
</div>
<div id=
<div id=
<div id=
<div id=
<div class=
<div style="position:absolute; left:170px; top:206px; z-index:800;">
<div align="center">
<asp:Panel ID="Panel1" runat="server" GroupingText="" BorderColor="#999999" Width="100%" Font-Size="14pt">
<fieldset style="margin-bottom: 20px;">
<legend style="font-weight: bold;">DECISION 2014 - CLOSING DATE: MARCH 21, 2014 @ 5:00PM</legend>
<table style="width: 100%">
<tr>
<td>
<asp:DataList ID="DataList1" runat="server" DataKeyNames="ElectionId"
DataSourceID="SqlDataSource1" Width="100%" CellPadding="3"
BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="0px"
GridLines="Vertical">
<ItemStyle BackColor="#EEEEEE" ForeColor="Black" />
<ItemTemplate>
<table style="width: 100%;">
<tr>
<td style="text-align: center;">
<asp:Label ID="Label2" runat="server" Font-Bold="True" Font-Size="X-Large"
Text=
<asp:Label ID="lbl_MessageType" runat="server" ForeColor="red" Text=
</td>
</tr>
<tr>
<td style="text-align: left;">
<div id="buttonDiv" runat="server">
<asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="true" align="center" style="width:20px;height:20px;zoom:120%; white-space:nowrap;">
</asp:RadioButtonList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" Runat="server"
ControlToValidate="RadioButtonList1" ForeColor="Red" Display="Dynamic" ErrorMessage="Required"></asp:RequiredFieldValidator>
</div>
<asp:CheckBoxList ID="CheckBoxList1" runat="server" align="center" style="width:20px;height:20px;zoom:120%; white-space:nowrap;">
</asp:CheckBoxList>
<hr />
<asp:CustomValidator ID="CustomValidator1" runat="server"
ClientValidationFunction="validateCheckBoxList" Display="static"
ErrorMessage="Please select at least one box." ForeColor="Red"></asp:CustomValidator>
<asp:TextBox ID="TextBox1" runat="server" Columns="30" Font-Bold="False"
Rows="5" TextMode="MultiLine" Visible="false"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" Runat="server"
ControlToValidate="TextBox1" Display="Dynamic" ErrorMessage="Required"></asp:RequiredFieldValidator>
</td>
</tr>
</table>
<asp:HiddenField ID="HiddenField1" runat="server"
Value=
<asp:HiddenField ID="HiddenField2" runat="server"
Value=
</ItemTemplate>
<HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
<HeaderTemplate>
<asp:Label ID="Label4" runat="server" Font-Bold="True"
Text=""></asp:Label>
<br />
Instructions: Select the candidate(s) of your choice by clicking the Checkbox <img src="images/check.png" alt="" /> and the the Oval <br /><img src="images/oval.png" alt="" /> adjacent to the candidate
<br /><img src="images/line.gif" alt="" />
<br />
</HeaderTemplate>
<AlternatingItemStyle BackColor="#DCDCDC" />
<FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
<FooterTemplate>
<tr vAlign="center">
<td align="center">
<asp:ImageButton ID="Button1" runat="server" alt="Submit"
ImageUrl="images/btn-submit-vote.png" OnClick="Button1_Click"
onmouseout="this.src='images/btn-submit-vote.png'"
onmouseover="this.src='images/btn-submit-vote.png'" style="text-align: center;"
title="Submit" />
</td></tr>
</FooterTemplate>
<SelectedItemStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
</asp:DataList>
<asp:Label ID="Label5" runat="server" EnableViewState="False" Font-Bold="True" ForeColor="Red"></asp:Label></td>
</tr>
</table>
</fieldset>
</asp:Panel>
<asp:label id="lblMsg" font-size="Medium" runat="server"></asp:label>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:BallotsConnectionString %>"
SelectCommand="SELECT [ElectionName_Position] = CASE WHEN GROUPING(mh.PositionId) = 0 THEN MAX(mh.Position) ELSE mh.ElectionName END
,CandidateName = CASE WHEN GROUPING(mh.PositionId) = 0 THEN MAX(mh.CandidateName) ELSE '' END
,PositionId = CASE WHEN GROUPING(mh.PositionId) = 0 THEN mh.PositionId ELSE 0 END
,AnswerType = CASE WHEN GROUPING(mh.PositionId) = 0 THEN MAX(mh.AnswerType) ELSE '' END
FROM PreAgg mh
GROUP BY ElectionName,PositionId WITH ROLLUP
HAVING GROUPING(mh.ElectionName) = 0
ORDER BY mh.ElectionName, GROUPING(mh.PositionId) DESC, mh.PositionID;">
<SelectParameters>
<asp:SessionParameter SessionField="ElectionId" Type="Int32" Name="ElectionId" DefaultValue="0" />
</SelectParameters>
</asp:SqlDataSource>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</body>
</html>
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If IsPostBack Then
Dim rb1 As CheckBoxList = DataList1.FindControl("RadioButtonList1")
rb1.Items.Add("writein")
Dim tb As TextBox = New System.Web.UI.WebControls.TextBox()
Dim btnDiv = DataList1.FindControl("buttonDiv")
tb.ID = "writein"
tb.Text = " "
tb.Visible = False
btnDiv.Controls.Add(tb)
End If
Protected Sub RadioButtonList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
Dim rbl As RadioButtonList = Page.Form.FindControl("RadioButtonList1")
If rbl.SelectedItem.Text = "Write In Candidate" Then
Page.Form.FindControl("writein").Visible = True
Else
Page.Form.FindControl("writein").Visible = False
End If
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs)
Dim questld As HiddenField = DataList1.FindControl("HiddenField2")
For Each item As DataListItem In DataList1.Items
If item.ItemType = ListItemType.Item Or item.ItemType = ListItemType.AlternatingItem Then
Dim positionid As Integer
Dim choiceid As Integer = 0
Dim choicetext As String = ""
positionid = CType(item.FindControl("HiddenField2"), HiddenField).Value
Dim anstype As HiddenField = item.FindControl("HiddenField1")
Select Case anstype.Value
Case "S"
Dim rbl As RadioButtonList = item.FindControl("RadioButtonList1")
Dim txt1 As TextBox = item.FindControl("writein")
If rbl.SelectedValue = 33 Then
txt1.Visible = True
Else
txt1.Visible = False
End If
choiceid = rbl.SelectedValue
SaveVotes(positionid, choiceid, "", "NA")
Case "M"
Dim cbl As CheckBoxList = item.FindControl("CheckBoxList1")
For i As Integer = 0 To cbl.Items.Count - 1
If cbl.Items(i).Selected Then
choiceid = cbl.Items(i).Value
SaveVotes(positionid, choiceid, "", "NA")
End If
Next
Case "T"
Dim txt As TextBox = item.FindControl("TextBox1")
choicetext = txt.Text
SaveVotes(positionid, 0, choicetext, "")
End Select
End If
Next
DataList1.Visible = False
End Sub
When I run this code, I get following error:
Object reference not set to an instance of an object.
Line 36: rb1.Items.Add("writein")
Thanks a lot in advance for your help
|
|
|
|
|
samflex wrote: Object reference not set to an instance of an object. The object rb1 has not been initialised; use your debugger to diagnose why this happens.
|
|
|
|