|
|
I have a checkboxlist populated by a datasource having a textbox as a controlparameter. The checkboxlist is located within a modalpopup. When I click the button, the checkboxlist shows the list pertaining to the previous select. If I close and click the button to show the modalpopup, the second click shows the updated checkboxlist. I've tried everything I can think of and nothing seems to work. The latest attempt is to have a dummy button (arcArcPat) for the modalpopup. I click on btnPrePat to get the dynamic checkbox, but no modalpopup appears. Of course, when I click on btnArcPat, everything's great because I've clicked on the btnPrePat first. I tried taking away the display:none; and then I only get a flash on the screen, nothing that stays. Help?
<pre lang="vb"><asp:Button ID="btnPrePat" runat="server" Text="pre arc" /><asp:Button ID="btnArcPat" runat="server" text="Search" />
<ajaxToolkit:ModalPopupExtender ID="mpePat" runat="server" TargetControlID="btnArcPat" PopupControlID="mpPat" DropShadow="true" BackgroundCssClass="modalBackground"></ajaxToolkit:ModalPopupExtender>
<asp:Panel ID="mpPat" runat="server" CssClass="modalPopup" Style="display: none;">
<asp:CheckBoxList ID="cblPat" runat="server" RepeatDirection="Vertical" Font-Size="12px" />
<asp:Button ID="btnPatClose" runat="server" Text="Close" />
</asp:Panel>
Protected Sub btnPrePat_Click(sender As Object, e As EventArgs) Handles btnPrePat.Click
ds = New Data.DataSet
strSql = "SELECT TOP (100) PERCENT t.patID, myType FROM blah, blah"
da = New Data.SqlClient.SqlDataAdapter(strSql, cn)
Try
da.Fill(ds, "patSearch1")
If ds.Tables("patSearch1").Rows.Count > 0 Then
cblPat.DataSource = ds.Tables("patSearch1")
cblPat.DataTextField = ds.Tables("pat").Columns("myType").ToString
cblPat.DataValueField = ds.Tables("pat").Columns("patID").ToString
cblPat.DataBind()
End If
Catch ex As Exception
Response.Write(ex.ToString)
End Try
mpePat.Show()
End Sub
</pre>
|
|
|
|
|
For anyone else, - just wanted you to know that I figured out the bigger problem. Something must have corrupted the ajaxcontroltoolkit installation just enough. Once I re-referenced it, everything started working fine. Sorry for the trouble and thanks for your help.
|
|
|
|
|
<form id="MonthlyAward" action="@Url.Action("SubmitAwards", "MonthlyAward")" method="post">
@Html.DropDownListFor(m => m.ddlProjectsID, Model.ProjectNames, "--Select--", new { id = "ddlProjects",name="ddl_ProjectnameText", onchange = "document.getElementById('TheForm').submit();" })
how to get selected item text in form collection
[HttpPost]
public ActionResult SubmitAwards(FormCollection collection, MonthlyAwardModel award)
{
string strProjectId = collection["ddlProjectsID"].ToString().Trim();
return View();
|
|
|
|
|
There are two ways.
1. Have a hidden field in the page and set the value of that field as
$("#hiddendfield").val($("#ddlProjectsID option:selected").text());
You need to this on OnChange event of the dropdown. after that call the form submit method. it will be better if you use $.ajax of the jquery for submission.
Then in by using formcollection you can get the value of that hidden field in the controller.
2. have the list again in the controller and fire a query in that list against the id selected. now you have the selected item and you can get the display text
|
|
|
|
|
I want to use this code
TextBox1.DataBindings.Add("Text",DataTable,"FName");<
in web application project but it does,t have the library.in web form the library is in the system.windows.forms.controlbindingscoll… but I can,t handle it in web application.what is the solution?
|
|
|
|
|
behrad kiani wrote: what is the solution?
IMO the best way for using databindings in a ASP.NET web application is to start with MVC[^].
Hope it helps you.
|
|
|
|
|
I m developing simple multiuser chat application in asp.net c# for my website.I have a table name chat in database.i have a chat.aspx.cs page which contains getmessage() addmessage() methods.i created 1 class file which contains getpreviousmsgcount() and newmsgcount() methods which returns the Count of total records in Chat table.now what i did is i drag two timers on my chat aspx page.
on timer1 tick event i retrieve prevmsgcount() and timer2 tick event i retrieve newmsgcount(),timer1 tick event get fired before timer 2.And in timer 2 i applied a following logic
if(newmgcount>prevmsgcount)
then refresh a page(so getmessage() gets called again and new messages are added).But in this case i observed timers keep on refreshing page on time interval."if" condition is getting ignored.how to ping sql server continously and track insertion of new record?is der any other way without using timer controls?
<b>Plz help with the code of C# and asp.net only.
Thanks in Advance.</b>
|
|
|
|
|
Can anyone send the links for ebook and preparation material of 70-487 Exam??
|
|
|
|
|
Have you tried to search for it with Google?
Use the best guess
|
|
|
|
|
i am disabling past dates and remaining dates in green color with the following code
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{if (e.Day.Date < DateTime.Today)
{
e.Day.IsSelectable = false;e.Cell.ForeColor = System.Drawing.Color.Gray;
}
else
{
e.Cell.ForeColor = System.Drawing.Color.Green;
} }
i have two dropdownlists ddlFrom and ddlTo.i vil select dates from these dropdownlists to book a room in a hotel.the dates fromdate to todate should appear in red color...any help is appreciated
|
|
|
|
|
Member 8701813 wrote: .any help is appreciated
Can you be specific on what kind of help you seek?
You shared the colors of dates in a calendar, next you talk of having start-end date in red color, what does it mean?
What exactly are you trying to do? Where are you stuck specifically when you tried?
|
|
|
|
|
i mean , i vil select dates from dropdown lists namely ddlfrom and ddlto dropdownlists to book a room in hotel.in a calender these dates which are selected from the above mentioned dropdownlists should appear in red color...which indicates those dates are booked....available dates are in green color...only dates which are in green color the user can book....red colored dates he cannot book...i tried this in selection_changed event ...but i couldn't meet this requirement...
|
|
|
|
|
hi,my requirement is changed now...i have to use 2 textboxes namely txtFrom and txtTo.i vil enter dates in these 2 textboxes..the dates mentioned from txtFrom to txtTo shuld appear in red color.i am converting string to date by the following code
DateTime FromDate = DateTime.ParseExact(txtFrom.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);
DateTime ToDate = DateTime.ParseExact(txtTo.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);
but how to implement in calender...pls give me any suggestion...
|
|
|
|
|
I am using Visual Studio 2012 C# ASP.NET on Windows 8 Virtual Machine. In the aspx page I am having below code :
<asp:TemplateField HeaderText="Active">
<FooterTemplate>
<asp:CheckBoxList ID="CheckBoxList2" runat="server">
<asp:ListItem>Act1</asp:ListItem>
<asp:ListItem>Act2</asp:ListItem>
<asp:ListItem>Act3</asp:ListItem>
</asp:CheckBoxList>
</FooterTemplate>
<ItemTemplate >
<asp:Label ID="Label7" runat="server" Text='<%# Eval("Active_Status") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate >
<asp:CheckBoxList ID="CheckBoxList2" runat="server">
<asp:ListItem>Act1</asp:ListItem>
<asp:ListItem>Act2</asp:ListItem>
<asp:ListItem>Act3</asp:ListItem>
</asp:CheckBoxList>
</EditItemTemplate>
</asp:TemplateField>
In the GridView1_RowDataBound I want to write the code for checked options of checkboxlist from database table column name Active_status; i.e. in the table I am storing values like "Act1,Act2,Act3" or "Act1" or "Act2, Act3" etc. So, as user clicks on Edit link button (i.e. putting Gridview in Editmode) the options of this checkboxlist should be checked marked respectively from table. Simultaneously, I wish to update the table as user changes the check option in the table something like "Act1,Act3" if user checked marked on Act1 and Act3 check options like wise in a single string column length 50.
I tried to search in google, but no luck. I am not sure, how clear I am asking the question, but if anything confusing or left by me, please let me know.
Thanks and Regards
Girish Sharma
|
|
|
|
|
how to make form to write an article on it and publish it
make the user read and put acomment on it with code please
|
|
|
|
|
Member 9925206 wrote: how to make form to write an article on it and publish it
Design the form. Then write the code to publish it.
Member 9925206 wrote: make the user read and put acomment on it with code please
Same procedure.
Or you could try Google
Frazzle the name say's it all
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
John F. Woods
|
|
|
|
|
This is fairly straight forward stuff. Try it and you should be able to do it.
Perhaps this blog engine could be useful for you. It has everything you need but the code syntax highlighting.
YaBlogEngine - A Tiny Blog Engine written in ASP.NET/C#[^]
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore, Dream. Discover.
|
|
|
|
|
how can i select one radio button .
male or female ?
|
|
|
|
|
See here[^].
Please also try and use a sensible title to your question, and clear details about what your problem is in the content.
Use the best guess
|
|
|
|
|
Hi,
I am creating a quiz program in ASP.Net with vb code. Already i have set required time (hh:mm:ss)for each topic in database. so when a user selects a quiz topic topic, i need to get the required time from database and want to count down the time and when it reaches 00:00:00, i need to stop running it and redirect to result page.
Please anyone help me.. I need it urgently
|
|
|
|
|
here's the msdn info on vb.net timer event
system.timers.timer.elapsed
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
|
|
|
|
|
How to print multiple pages of listview with default page setting.
i want to set only 8 record in my page after that next 8 records should be print into new page and so on.
i tried so many code and css but unable to set default margine. margine which i am setting is only working for first 2- 3 pages after that records getting merge.
plz help me at this point of time i got frestrated i am tring to acheive this last 3 days but unable to do.below is css and page script which i am using for page.
<pre lang="HTML"><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<link rel="stylesheet" type="text/css" href="../css/jquery.fancybox-1.3.4.css" media="screen" />
<script type="text/javascript" src="../js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="../js/jquery.fancybox-1.3.4.pack.js"></script>
<script type="text/javascript">
function printpage() {
window.print()
}
</script>
<style>
.memberDetailTab td
{
text-align: center;
}
</style>
<div class="non-printable">
<center>
<h1 class="non-printable">
Print Address Slips</h1>
</center>
<div class="control">
<table style="margin: 0px auto; border: solid 1px #DCDCD6; width: 70px; page-break-before: always;">
<tr>
<td class="style2">
</td>
<td>
</td>
</tr>
<tr>
<td align="center">
<asp:DropDownList ID="DDLprint" runat="server" OnSelectedIndexChanged="DDLprint_SelectedIndexChanged"
AutoPostBack="true">
<asp:ListItem Value="0" Selected="True">Select Slip type</asp:ListItem>
<asp:ListItem Value="1">Print All Slip</asp:ListItem>
<asp:ListItem Value="2">Print Valid Slips</asp:ListItem>
<asp:ListItem Value="3">Print Updated Slips</asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:Button ID="Print" Text="Print Slips" runat="server" OnClick="Print_Click" />
</td>
</tr>
<tr>
<td class="style2">
</td>
<td>
<br />
</td>
</tr>
</table>
</div>
</div>
<div id='main-content' style="overflow: auto; height: 50%; width: 100%" class="printable" />
<asp:ListView ID="LSVAllSlips" runat="server" GroupItemCount="2" GroupPlaceholderID="groupPlaceholder1"
ItemPlaceholderID="itemPlaceholder1" OnPagePropertiesChanged="LSVAllSlips_PagePropertiesChanged">
<LayoutTemplate>
<table>
<tr id="groupPlaceholder1" runat="server" align="center">
</tr>
</table>
</LayoutTemplate>
<GroupTemplate>
<tr>
<td id="itemPlaceholder1" runat="server">
</td>
</tr>
</GroupTemplate>
<ItemTemplate>
<td>
<div class="textRotate">
<asp:Image ID="imgUrl" runat="server" ImageUrl='<%# Eval("Image")%>' Height="10mm" /></div>
<%-- <asp:Label ID="lblmemid" runat="server" Text='<%# Eval("MemberShipid") %>' Font-Bold="True"--%>
<%--Font-Size="Larger" />--%>
</td>
<td align="left" style="width: 8.5cm; height: 32.15mm; background: #dedede;">
<asp:Label ID="lblname" runat="server" Text='<%# Eval("Name") %>' Font-Size="12px"
Font-Bold="true" /><br />
<asp:Label ID="lbladd" runat="server" Text='<%# Eval("Address") %>' Font-Size="12px" /><br />
<asp:Label ID="lblcity" runat="server" Text='<%# Eval("City") %>' Font-Size="12px" />,
<asp:Label ID="lblstate" runat="server" Text='<%# Eval("State") %>' Font-Size="12px" />
-
<asp:Label ID="lblpin" runat="server" Text='<%# Eval("Pincode") %>' Font-Size="12px" /><br />
<asp:Label ID="lblcountry" runat="server" Text='<%# Eval("Country") %>' Font-Size="12px" /><br />
Mob:
<asp:Label ID="lblmo" runat="server" Text='<%# Eval("Mobile1") %>' Font-Size="12px" />
Ph:
<asp:Label ID="lblph" runat="server" Text='<%# Eval("Phone1") %>' Font-Size="12px" />
</td>
<td style="width: 5mm;">
</td>
</ItemTemplate>
<GroupSeparatorTemplate>
<tr id="Tr1" runat="server">
<td colspan="6" style="height: 2.0mm">
</td>
</tr>
</GroupSeparatorTemplate>
</asp:ListView>
</div>
<%--<div>
<asp:ListView ID="ListView1" runat="server" OnItemDataBound="OnItemDataBound" GroupPlaceholderID="groupPlaceHolder1"
ItemPlaceholderID="itemPlaceHolder1">
<LayoutTemplate>
<table cellpadding="2" cellspacing="0" border="1" style="width: 200px; border: dashed 2px #04AFEF;
background-color: #B0E2F5">
<asp:PlaceHolder runat="server" ID="groupPlaceHolder1"></asp:PlaceHolder>
</table>
</LayoutTemplate>
<GroupTemplate>
<tr>
<asp:PlaceHolder runat="server" ID="itemPlaceHolder1"></asp:PlaceHolder>
</tr>
</GroupTemplate>
<ItemTemplate>
<td>
<asp:Label ID="lblItem" runat="server" Text='<%# Eval("Item") %>'></asp:Label>
</td>
<td>
<asp:HiddenField ID="hfBarCode" runat="server" Value='<%# Eval("Barcode") %>' />
<asp:Image ID="imgBarCode" runat="server" />
</td>
</ItemTemplate>
</asp:ListView> </div>--%>
</asp:Content>
<style>
@media print
{
.header, .hide
{
visibility: hidden;
display: none;
}
body
{
font-size: 10pt;
padding: 0px;
margin: 0px 0px 0px 0px;
}
.non-printable
{
display: none;
}
.printable
{
display: block;
display: block;
margin: 0px 0px 0px 0px;
}
}
@page
{
margin: 3.0mm 0mm 0mm 16mm;
}
.textRotate
{
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
transform: rotate(-90deg);
position: relative;
width: 60px;
}
.textRotate img
{
margin: 0px;
padding: 0px;
position: absolute;
top: -25px;
left: -20px;
}
</style>
|
|
|
|
|
I have a table that uses Ajax to load. It is basically set up like this:
@using (Ajax.BeginForm(ajaxOpts))
{
<table>
<thead>
<th>column 1</th>
<th>column 2</th>
</thead>
<tbody>
@Html.Action("List")
</tbody>
</table>
}
In each row that is returned is a button that I have created a jquery event. It opens a dialog that displays some addition details about the record.
$(".view-row-button").click(function () {
var $id = $(this).attr("id");
$("#details-dialog")
.load('@Url.Action("action", "controller")' + '?record=' + $id)
.dialog({
modal: true,
height: 750,
width: 1200,
close: function () {
//refresh table
$("#refresh-button").click();
}
}).dialog("open");
});
The first time I click the row button, everything works great. The action is called and the details of the record are queried. The next time, the dialog is still displayed, but it is not updated with any changes I may have made. I put a breakpoint in the action, which catches on the first click, but not the next clicks. I've tried refreshing the page, but that still doesn't work. I have to re-open the browser to get the click to work properly again. Any suggestions?
|
|
|
|
|
It can be a problem of your browser which is not refreshing the page properly because especially IE is well-known for "not properly refreshing the cache". Try to do this:
- click the row button
- The action is called and the details of the record are queried.
Then delete the whole cache of the browser and click the row button again. If then everything is working fine, you know that it is a browser-problem which you can't solve.
|
|
|
|