|
I need replace a selected word in the text of textBox not all text
I can´t use SelectedText or SelectionLength like windows Form in asp.net and I do not know what that word is selected....
|
|
|
|
|
|
You can use String.Replace. Like,
myString = "This is a test.";
myString = Regex.Replace(myString, " is", " was");
|
|
|
|
|
the question is I do not know that word is selected.
|
|
|
|
|
Good Evening All
i have another Question. i have created a Function that creates a Cookie with a Domain like this
private static void SetCookieExtedend(String key, String value, String path)
{
DateTime expires = DateTime.UtcNow + TimeSpan.FromDays(2000);
bool secure = false;
String domain = "Ecash";
StringBuilder cookie = new StringBuilder();
cookie.Append(String.Concat(key, "=", value));
if (expires != null)
{
cookie.Append(String.Concat(";expires=", expires.ToString("R")));
}
if (!String.IsNullOrEmpty(path))
{
cookie.Append(String.Concat(";path=", path));
}
if (!String.IsNullOrEmpty(domain))
{
cookie.Append(String.Concat(";domain=", domain));
}
if (secure)
{
cookie.Append(";secure");
}
HtmlPage.Document.SetProperty("cookie", cookie.ToString());
}
and its working well , i have set the Cookie and it was stored as this
UserID=142;expires=Mon, 14 Nov 2016 16:58:19 GMT;domain=Ecash
now i want to retrieve the Value of the Cookie and i have a function that does it like this
public static string GetCookie(string key)
{
string[] cookies = HtmlPage.Document.Cookies.Split(';');
key += '=';
foreach (string cookie in cookies)
{
string cookieStr = cookie.Trim();
if (cookieStr.StartsWith(key, StringComparison.OrdinalIgnoreCase))
{
string[] vals = cookieStr.Split('=');
if (vals.Length >= 2)
{
return vals[1];
}
return string.Empty;
}
}
return null;
}
the Following Line comes back with an empty String
string[] cookies = HtmlPage.Document.Cookies.Split(';');
Why ?
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Why are you not using the HTTPCookie[^] class?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi all,
I have a log table of my website in which we are maintains the log of the users.
I want to export data of this table in excel format.for this I made an SP(store procedure)in which I pass the date range and
according to date range I was able to generate the excel file.
Now I want to export data with multiple sheets with different information.
so please give me some hints/code by which I can export the data in the multiple sheets
thanks........
|
|
|
|
|
|
thanks for giving reply.
actually I am generating excel file by sql (store Procedure)with out using dot net code.
because I have to attached this file in the mail of web administrator.the mail will go each first day of the week/month.
by sql job
|
|
|
|
|
Hi All,
I have a dataset with table values in code behind,
which I want to save all the rows to the database(sql server);
i.e coping dataset to table(DB)
Please help me with this, searched but could not get the proper solution.
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
|
|
|
|
|
Ramkumar_S wrote: Please help me with this, searched but could not get the proper solution
First search result gives an article[^] from CodeProject. Second result goes to StackOverflow[^].
When searching you'll rarely encounter a solution that exactly fills your needs. You search for examples (not solutions) and adapt those.
Bastard Programmer from Hell
|
|
|
|
|
|
Hi All,
In a batch file which runs few Windows Services in intranet env there is some thing like this
"set ssimpath=%~dp0..\..\Deployment\B2B_WapSvr\C\Program Files\FTG\B2B\WindowsServices\Score". Can anybody let me whats the meaning of it. Means whats the value that is set to ssimpath variable.
Actually what is the meaning of %~dp0, is this realted to Win NT OS or is it related to XP. My local machine has XP in which couple of applications exist.
But may be the B2B_WapSvr is a Win NT server. So please advice me on this regard.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
AFAIK, %~dp0 does not have a meaning in Windows; would be specific to the application that is reading the variable called 'ssimpath'.
Bastard Programmer from Hell
|
|
|
|
|
guys;
In Microsoft Ajax we define an Enum like:
AjaxServerControl1.Priority = function() {}
AjaxServerControl1.Priority.prototype = {
RealTime: 6,
High: 5,
AboveNormal: 4,
Normal: 3,
BelowNormal: 2,
Low: 1
}
AjaxServerControl1.Priority.registerEnum('AjaxServerControl1.Priority');
now how to get the string denoting a value e.i. Priority.High.ToString()
Help people,so poeple can help you.
|
|
|
|
|
If i click A button, user go to homepage.com/B.aspx
But i want to homepage.com insetead of homepage.com/B.aspx.
Is there any way?
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|
|
Learn HTML. /troll
You could at least post the code with the link in it or the relevant page request.
|
|
|
|
|
This is a perfectly reasonable newbie question. Posting the code won't help either: it just isn't relevant here.
|
|
|
|
|
You can use iframe, master page, etc. if you don't want to use coding.
Otherwise you can use url routing code in ASP.NET.
You can find it's coding on msdn
Tarun Mangukiya
|
|
|
|
|
If B.aspx is always the page you want to display for http://homepage.com then google for "Set Default Pages in IIS", you can also set this in your web.config. You could also rename "b.aspx" to one of the existing defaults such as "default.aspx" See http://stackoverflow.com/questions/1913058/set-default-page-in-asp-net[^]
If you are worried about neater URLs generally you could consider ASP.NET MVC3, but there is a learning curve. Another answer would be to write an HttpHandler to map a clean URL to the actual page, but this will get unweildy and might be a little technically complicated, so MVC3 might be a better option.
|
|
|
|
|
do the url re-write to hide anything.
tbhattacharjee
|
|
|
|
|
If you can, I recommend using a MultiView instead of multiple pages. Depends on what exactly you are trying to accomplish though (e.g., you didn't say whether or not the button will also reside on homepage.com).
|
|
|
|
|
|
Hi,
When i'm trying to get the user that login to windows when my application is on IIS i'm getting this user: IUSER.
I think it's somethink from the IIS because it works fime when it's running on my local computer.
i tried adding to the web.config-
<authentication mode="Windows"/>
<identity impersonate="false"/>
But still nothing.
Can someone please help me?
|
|
|
|
|
In what context? Trying to access another resource (like SQL server) and pass through the login?
If so, Google "IIS double hop" and see what the prob is and how to fix it.
|
|
|
|