|
check these links
http://www.codeproject.com/KB/cpp/SendSmsThroughWS.aspx
http://www.webservicex.net/SendSMS.asmx
http://mashable.com/2008/04/19/send-text-messages/
http://www.csoft.co.uk/sms/api/http_to_sms.htm
those might help.
|
|
|
|
|
hiiii
I have created a menu dynamically and populated it dynamically.
now i want to create a eventhandler so that on clicking the menu item the page gets redirected to particular page.plz help me.i hav written following code:
private void populatemenu1()
{
//string menu = "menu" + i;
DataSet ds = GetDataSetForMenu1();
Menu menu = new Menu();
foreach (DataRow parentItem in ds.Tables["Menu"].Rows)
{
MenuItem submenu = new MenuItem((string)parentItem["Menu"]);
menu.Items.Add(submenu);
foreach (DataRow childItem in parentItem.GetChildRows("SubMenu"))
{
MenuItem childrenItem = new MenuItem((string)childItem["SubMenu"]);
submenu.ChildItems.Add(childrenItem);
}
}
menu.StaticMenuItemStyle.ForeColor = System.Drawing.Color.Black;
//menu.StaticMenuItemStyle.ForeColor = System.Drawing.Color.Black;
menu.StaticMenuItemStyle.Font.Bold = true;
menu.DynamicMenuItemStyle.ForeColor = System.Drawing.Color.Black;
menu.DynamicMenuItemStyle.Font.Bold = true;
menu.DynamicVerticalOffset = 25;
menu.DynamicHorizontalOffset = -75;
//menu.Click += new System.EventHandler(this.menu_Click);
//menu_Click( object sender, System.EventArgs e);
//menu.MenuItemClick += new System.EventHandler(this.menu_Click);
Panel2.Controls.Add(menu);
Panel2.DataBind();
}
private DataSet GetDataSetForMenu1()
{
SqlConnection myConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Jajaipur"].ConnectionString);
SqlDataAdapter adCat = new SqlDataAdapter("SELECT * FROM Menu Where MenuId=1", myConnection);
SqlDataAdapter adProd = new SqlDataAdapter("SELECT * FROM SubMenu Where MenuId=1", myConnection);
DataSet ds = new DataSet();
adCat.Fill(ds, "Menu");
adProd.Fill(ds, "SubMenu");
ds.Relations.Add("SubMenu",ds.Tables["Menu"].Columns["MenuId"],
ds.Tables["SubMenu"].Columns["MenuId"]);
return ds;
}
thanks....
|
|
|
|
|
set
childrenItem.NavigateUrl="PageUrl";
|
|
|
|
|
hiii
its ok but how wud u know that which item is clicked....without using eventhandler.
this line will redirect all childitems to common page...
|
|
|
|
|
if u want to dynamically assign diffrent URL to each item.
then save Navigate Url To table from where u picking the
chiled items.
or
Use
MenuItem item = new MenuItem("Default");
if (item.Text == "Default")
item.NavigateUrl = "Default.aspx";
else if (item.Text == "Home")
item.NavigateUrl = "Home.aspx";
else if()
{
}
|
|
|
|
|
this line is givin error when m writtin it in csharp.
the error is:
cannot convert implicitly string to bool.
|
|
|
|
|
i have added the last (else if) code for more conditions if you have.
i am giving you an example.
if u r using the same then remove the last (else if)
|
|
|
|
|
You have to set NavigateURL for the MenuItem.
MenuItem.NavigateUrl="Default.aspx"
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
sir....
ihav done this but it just redirect all childitems to single page.
i want that on clicking each item it redirects to different page....
thnks...
|
|
|
|
|
pariofshona wrote: it just redirect all childitems to single page
Because I guess you gave only single page url. While retreving Menu name from DB, load the corresponding Page Name, and set the navigate url.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
how to load the corresponding page name...
i hav 2 table menu,submenu.
columns in menu are menu and menuid.
columns in submenu are menuid,submenuid,submenu.
i hav linked both table on basis of menuid col...
thnks....
|
|
|
|
|
You must be having seperate url for evry child item.Get those urls and at the time of create a new menuitem set the NavigateUrl property which you picked you from DB.
Cheers!!
Brij
|
|
|
|
|
Frnds,
I have got 5 panels with diff, data on it.
For 5 type of user the panels are created but for admin login all 5 panels must be visible at a time. So the position of panel have to be diff.
BUT when user five login and see his content than that panel appeares at the bottom (i make all the above 4 panel visible=false).
What i want the positon of panel to be set from my c# code that is .cs file.
Is there any x,y co-ordinates of panel???
|
|
|
|
|
Rather than Panel, Use Div . And hide and Unhide them accordingly. This will resolve your problem
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
asp:panel renders to a div. Use style property to assign position arguments like :
<asp:Panel ID="pnl" runat="server" Style="left: 100; top: 500; background-color:Red; border: solid 1; padding: 10; position:absolute;">
This is a panel</asp:Panel>
to do your job.
|
|
|
|
|
Thanks 4 the help, but a new problem is occured...
when logging as single user things are working fine..., means the position is perfect and as required.
But when im logging as ADMIN than all panels get mixed up... why???
|
|
|
|
|
Check the Client HTML it renders when you login using Admin. this might help you on what is wrong with Admin.
|
|
|
|
|
i want develop a excel like interface in my asp.net page. can anyone help me to do this.... or is there any open source excel like gridview available.i did search google but did not find anything such like that.
Thanks
tbhattacharjee
|
|
|
|
|
Use Gridview with Textbox as Template Field. Or you can use table for that . What is the actual purpose ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
|
thanks for your help. cheers
tbhattacharjee
|
|
|
|
|
<%@ Page Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="Visitor.aspx.cs" Inherits="SMS.Visitor" Title="VisitorForm" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link type="text/css" rel="Stylesheet" href="_assets1/css/panel.css" />
<link type="text/css" rel="Stylesheet" href="_assets1/css/pager.css" />
<link type="text/css" rel="Stylesheet" href="_assets1/css/grid.css" />
<link type="text/css" rel="Stylesheet" href="_assets1/css/filter.css" />
<style type="text/css">
#demo
{
font-size: small;
}
.panel .header .content H2
{
font-size: 12pt;
font-weight: bold;
color: #fff;
padding: 12px 0px 0px 8px;
margin: 0;
float: left;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div>
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<div id="processMessage" style="display: none">
<img alt="Loading" src="images/loading.gif" />
content loading...</div>
</ProgressTemplate>
</asp:UpdateProgress>
</div>
<script type="text/javascript">
function pageLoad(sender, args) {
var autoComplete = $find('autoCompleteTotal');
autoComplete.add_populating(function() {
// use the filter as the context key
autoComplete.set_contextKey($get('<%= this.ddlFilterTotal.ClientID %>').value);
});
autoComplete.add_itemSelected(function() {
// force the panel to refresh
__doPostBack('<%= this.updPanelTotal.ClientID %>', '');
});
}
</script>
<asp:UpdatePanel ID="updPanelTotal" runat="server">
<ContentTemplate>
<asp:ObjectDataSource ID="odsTotalStudents" runat="server" SelectMethod="Select"
TypeName="SMS.Visitor" OnSelecting="Selecting">
<SelectParameters>
<asp:Parameter Name="propertyName" Type="String" />
<asp:Parameter Name="propertyValue" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:Panel ID="Panel1" runat="server">
<table width="100%">
<tr>
<td>
Name
</td>
<td>
<asp:TextBox ID="txt_VisitorName" runat="server" MaxLength="50"></asp:TextBox>
<cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="txt_VisitorName"
FilterType="Custom,UppercaseLetters,LowercaseLetters" Enabled="True">
</cc1:FilteredTextBoxExtender>
<asp:RequiredFieldValidator ID="rfv_ConsultedDate" runat="server"
ControlToValidate="txt_VisitorName" Display="None"
ErrorMessage="Enter visitor name" ToolTip="Please enter date"
SetFocusOnError="True"></asp:RequiredFieldValidator>
<cc1:ValidatorCalloutExtender ID="vce_rfv_ConsultedDate" TargetControlID="rfv_ConsultedDate" HighlightCssClass="validatorCalloutHighlight" runat="server">
</cc1:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td>
Whoom to meet
</td>
<td>
<asp:TextBox ID="TextBox1" runat="server" MaxLength="50"></asp:TextBox>
<cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" TargetControlID="TextBox1"
FilterType="Custom,UppercaseLetters,LowercaseLetters" Enabled="True">
</cc1:FilteredTextBoxExtender>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="TextBox1" Display="None"
ErrorMessage="Enter whom to meet" ToolTip="Please enter date"
SetFocusOnError="True"></asp:RequiredFieldValidator>
<cc1:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" TargetControlID="RequiredFieldValidator1" HighlightCssClass="validatorCalloutHighlight" runat="server">
</cc1:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td>
Room no
</td>
<td>
<asp:TextBox ID="txt_RoomNo" runat="server" MaxLength="50"></asp:TextBox>
<asp:Button ID="btn_Search" runat="server" Text="Search"
onclick="btn_Search_Click" CausesValidation="False" />
</td>
</tr>
<tr>
<td>
Vehicle no
</td>
<td>
<asp:TextBox ID="txt_VehicalNo" runat="server" MaxLength="9"></asp:TextBox>
<cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" runat="server" TargetControlID="TextBox1"
FilterType="Numbers,Custom,UppercaseLetters,LowercaseLetters" Enabled="True"/>
</td>
</tr>
<tr>
<td>
In-time
</td>
<td>
<asp:TextBox ID="txt_InTime" runat="server" MaxLength="8"></asp:TextBox>
<cc1:MaskedEditExtender ID="txtSecStart_MaskedEditExtender" runat="server" TargetControlID="txt_InTime"
MaskType="Time" AcceptAMPM="true" Mask="99:99" MessageValidatorTip="true">
</cc1:MaskedEditExtender>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="TextBox1" Display="None"
ErrorMessage="Enter visitor name" ToolTip="Please valid date"
SetFocusOnError="True"></asp:RequiredFieldValidator>
<cc1:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" TargetControlID="RequiredFieldValidator2" HighlightCssClass="validatorCalloutHighlight" runat="server">
</cc1:ValidatorCalloutExtender>
</td>
</tr>
<tr valign="top">
<td>
Purpose
</td>
<td >
<asp:TextBox ID="txt_Purpose" runat="server" Height="130px"
TextMode="MultiLine" Width="300px"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right">
</td>
<td align="left">
<asp:Button ID="btnSubmit" runat="server" Text="Submit"
onclick="btnSubmit_Click" />
<asp:Button ID="btnCancel" runat="server" Text="Cancel"
CausesValidation="False" />
<asp:Button ID="Button1" runat="server" style="display:none" Text="Button" />
<asp:Button ID="Button2" runat="server" style="display:none" Text="Button" />
</td>
</tr>
</table>
</asp:Panel>
<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="Button1"
PopupControlID="Panel2" CancelControlID="Button2" BackgroundCssClass="modalBackground"
DropShadow="true" BehaviorID="mdl">
</cc1:ModalPopupExtender>
<asp:Panel ID="Panel2" runat="server" Style="display: none; background-color: White;
border-width: 2px; border-color: Black; border-style: solid; padding: 20px;">
<table width="100%">
<tr>
<td>
</td>
<td align="right">
<asp:LinkButton ID="LinkButton1" runat="server">Close</asp:LinkButton>
</td>
</tr>
</table>
<div id="dlg" class="panel" style="width: 436px">
<div class="header" style="cursor: default">
<div class="outer">
<div class="inner">
<div class="content">
<h2>
</h2>
<div class="filter">
<asp:DropDownList ID="ddlFilterTotal" runat="server">
<asp:ListItem Text="First Name" Value="firstname" />
<asp:ListItem Text="Last Name" Value="lastname" />
<asp:ListItem Text="Room No" Value="class_section" />
</asp:DropDownList>
<asp:TextBox ID="txtFilter" runat="server" autocomplete="off" OnTextChanged="FilterChanged" />
<cc1:AutoCompleteExtender ID="txtFilter_AutoCompleteExtender" runat="server" DelimiterCharacters=""
Enabled="True" ServicePath="" TargetControlID="txtFilter" ServiceMethod="GetCompletionList"
UseContextKey="true" ContextKey="test" MinimumPrefixLength="1" BehaviorID="autoCompleteTotal"
CompletionListCssClass="autocomplete_list" CompletionListItemCssClass="autocomplete_listItem"
CompletionListHighlightedItemCssClass="autocomplete_highlighted_listitem">
</cc1:AutoCompleteExtender>
<asp:ImageButton ID="btnClear" runat="server" AlternateText="Remove Filter" ImageUrl="~/images/clear.gif"
OnClick="ClearFilter" Height="16px" Width="16px" />
</div>
</div>
</div>
</div>
</div>
<div class="body">
<div class="outer">
<div class="inner">
<div class="content">
<asp:ListView ID="lvCustomers" runat="server" class="grid" DataSourceID="odsTotalStudents"
onitemcommand="lvCustomers_ItemCommand">
<LayoutTemplate>
<table id="customers" runat="server" cellspacing="0" border="0">
<tr>
<th>
<asp:LinkButton ID="btnSortLastName" runat="server" Text="First name" CommandName="Sort"
CommandArgument="lastname" />
</th>
<th>
<asp:LinkButton ID="btnSortFirstName" runat="server" Text="Last name" CommandName="Sort"
CommandArgument="lastname" />
</th>
<th>
<asp:LinkButton ID="btnBlockName" runat="server" Text="Block" CommandName="Sort"
CommandArgument="Block name" />
</th>
<th>
<asp:LinkButton ID="LinkButton2" runat="server" Text="Roomno" CommandName="Sort"
CommandArgument="Room no" />
</th>
<th>
</th>
</tr>
<tr id="itemPlaceholder" runat="server" />
<tr class="pager">
<td colspan="6">
<div class="container">
<asp:DataPager ID="pager" runat="server" PageSize="5">
<Fields>
<asp:TemplatePagerField OnPagerCommand="PagerCommand">
<PagerTemplate>
<div class="command">
<asp:ImageButton ID="btnFirst" runat="server" CommandName="First" ImageUrl="~/images/first.gif"
AlternateText="First Page" ToolTip="First Page" />
<asp:ImageButton ID="btnPrevious" runat="server" CommandName="Previous" ImageUrl="~/images/prev.gif"
AlternateText="Previous Page" ToolTip="Previous Page" />
</div>
<div class="command">
<asp:TextBox ID="txtSlider" runat="server" Text='<%#
Container.TotalRowCount > 0
? Math.Ceiling(((double)(Container.StartRowIndex + Container.MaximumRows) / Container.MaximumRows))
: 0
%>' AutoPostBack="true" OnTextChanged="CurrentPageChanged" Style="visibility: hidden" />
<cc1:SliderExtender ID="slider" BehaviorID="slider" runat="server" TargetControlID="txtSlider"
Orientation="Horizontal" Minimum="1" Maximum='<%# Math.Ceiling((double)Container.TotalRowCount / Container.MaximumRows) %>'
TooltipText='<%# "Page {0} of " + Math.Ceiling ((double)Container.TotalRowCount / Container.MaximumRows).ToString() + " (" + Container.TotalRowCount + " items)" %>' />
</div>
<div class="command">
<asp:ImageButton ID="btnNext" runat="server" CommandName="Next" ImageUrl="~/images/next.gif"
AlternateText="Next Page" ToolTip="Next Page" />
<asp:ImageButton ID="btnLast" runat="server" CommandName="Last" ImageUrl="~/images/last.gif"
AlternateText="Last Page" ToolTip="Last Page" />
</div>
<br />
<div class="info">
Page <b>
<%# Container.TotalRowCount > 0 ? Math.Ceiling(((double)(Container.StartRowIndex + Container.MaximumRows) / Container.MaximumRows)) : 0 %>
</b>of <b>
<%# Math.Ceiling((double)Container.TotalRowCount / Container.MaximumRows)%>
</b>(<%# Container.TotalRowCount %>
items)
</div>
</PagerTemplate>
</asp:TemplatePagerField>
</Fields>
</asp:DataPager>
</div>
</td>
</tr>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr id="row" runat="server" class='<%# Container.DataItemIndex % 2 == 0 ? "row" : "altrow" %>'>
<td>
<asp:Label ID="lbl_FirstName" runat="server" Text='<%# Eval("firstName")%>'></asp:Label>
</td>
<td>
<asp:Label ID="lbl_LastName" runat="server" Text='<%# Eval("lastName")%>'></asp:Label>
</td>
<td>
<asp:Label ID="lbl_BlockName" runat="server" Text='<%# Eval("BlockName")%>'></asp:Label>
</td>
<td>
<asp:Label ID="Label1" runat="server" Text='<%#Eval("RoomName")%>'></asp:Label>
</td>
<td>
<asp:LinkButton ID="lbtn_Select" runat="server" CommandName="Select" CommandArgument='<%# Container.DataItemIndex+1%>'>Select</asp:LinkButton>
</td>
</tr>
</ItemTemplate>
</asp:ListView>
</div>
</div>
</div>
</div>
<div class="footer">
<div class="outer">
<div class="inner">
<div class="content">
</div>
</div>
</div>
</div>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
when the auto complete is out of modalpopup it wiorks fne but when i put in modalpopup its not working.
and the slider for the listbox also not working when it is out of modalpopup its working can any body trace the error when it is?i am new to dotnet and thanks in advance
hi
modified on Friday, July 24, 2009 2:15 AM
|
|
|
|
|
Does it any makes sense to put all these stuff. Why you are not giving only relavant code?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Dear All Please help
Why now i can not send any email from my script in web page (www.popzone.asia)?
It reply like this if i use with smtp.popzone.asia
"The server rejected one or more recipient addresses. The server response was: 554 5.7.1 <narithchap@yahoo.com>: Relay access denied"
But if i use with localhost or mail.popzone.asia it reply "the transportation fail can not connect to the server"
Before my sending email from script in my web work normally but after i send newsletter to my 19 members it happen like this please help..........
However i notice that there is one email that invalid the email address.
Thank
|
|
|
|
|
The error means what it says. The mail server is not allowing you relay access, which means it thinks you're using their server, but not logged in to them.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|